From bc5a97766913c8c6b38ea7e9fe5d3d4ceed812c8 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Wed, 27 Jul 2022 23:21:55 +0100 Subject: [PATCH] fix popup menu not appearing when nothing was typed --- gui/src/main/groovy/com/muwire/gui/chat/ChatEntryPane.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui/src/main/groovy/com/muwire/gui/chat/ChatEntryPane.groovy b/gui/src/main/groovy/com/muwire/gui/chat/ChatEntryPane.groovy index 4198b219..3798773c 100644 --- a/gui/src/main/groovy/com/muwire/gui/chat/ChatEntryPane.groovy +++ b/gui/src/main/groovy/com/muwire/gui/chat/ChatEntryPane.groovy @@ -47,6 +47,8 @@ class ChatEntryPane extends JTextPane { void keyTyped(KeyEvent e) { if (e.getKeyChar() == AT) { lastPoint = getCaret().getMagicCaretPosition() + if (lastPoint == null) + lastPoint = getBounds().getLocation() lastComponent = e.getComponent() if (lastPoint == null || lastComponent == null) return