Class LinuxPopupMenuCanceler

java.lang.Object
java.awt.event.WindowAdapter
com.formdev.flatlaf.LinuxPopupMenuCanceler
All Implemented Interfaces:
ComponentListener, WindowFocusListener, WindowListener, WindowStateListener, EventListener, ChangeListener

class LinuxPopupMenuCanceler extends WindowAdapter implements ChangeListener, ComponentListener
Cancels (hides) popup menus on Linux.

On Linux, popups are not hidden under following conditions, which results in misplaced popups:

  • window moved or resized
  • window maximized or restored
  • window iconified
  • window deactivated (e.g. activated other application)
On Windows and macOS, popups are automatically hidden.

The implementation is similar to what's done in javax.swing.plaf.basic.BasicPopupMenuUI.MouseGrabber, but only hides popup in some conditions.