Skip to content

Menus fail to close if you move your mouse and click fast enough #12

@nyanpasu64

Description

@nyanpasu64

Menu handling is rather bugged, with multiple symptoms I think share the same root cause:

Clicking a new menu item fails to close the menu:

Tested on multiple Linux DEs, both X and Wayland:

  • Open a menu.
  • Click and hold anywhere on the window (either on or off the menu) to close it. (The bug occurs regardless if you hold it for a short or long time.)
  • Shortly before or after releasing the mouse, hover a different menu item. (Optionally move your mouse off the menu bar.)

The new menu will open. This will not happen if you put more of a gap between moving the mouse and hovering a menu item.

This behavior is absent from GTK4 apps (not many have menu bars, try gtk4-widget-factory, Page 2) and Qt apps (most KDE apps have menu bars).

gtk3-widget-factory kinda has this behavior. It's even more lenient if you click on a menu item, move your mouse to a different one, and release it. But if you click off a menu item, I was unable to keep the menu open.

nativeshell.menu.reopening.60fps.mp4

Clicking the window fails to close the menu:

This is a lot trickier to reproduce than the above, but is more clearly a bug (rather than a defensible choice of behavior).

  • Click and release a menu to open it. Keep your mouse on one menu.
  • Move your mouse to another menu item, then off the menu bar, then click the mouse before the new menu appears. Release the mouse rapidly.

If you get it right, the new menu appears, and doesn't close even though you clicked the window background to close the new menu.

nativeshell.menu.not.closing.60fps.mp4

These videos were recorded at 60fps. I recommend watching them in mpv, using , and . for frame rewind and advance (or [ and ] for slow motion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions