Linux: ensure that old LinuxPopupMenuCanceler window listener is removed before adding a new one (issue #962)

(did not yet happen...)
This commit is contained in:
Karl Tauber
2025-07-12 16:28:49 +02:00
parent 04ad21b5b6
commit f71dbb2647

View File

@@ -70,6 +70,8 @@ class LinuxPopupMenuCanceler
}
private void addWindowListeners( MenuElement selected ) {
removeWindowListeners();
// see BasicPopupMenuUI.MouseGrabber.grabWindow()
Component invoker = selected.getComponent();
if( invoker instanceof JPopupMenu )