nativeshell / examples

Other
63 stars 7 forks source link

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

Open nyanpasu64 opened 3 years ago

nyanpasu64 commented 3 years ago

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:

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.

https://user-images.githubusercontent.com/913957/123017614-cb4d1300-d381-11eb-8d9d-2a2fd5c1a56d.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).

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.

https://user-images.githubusercontent.com/913957/123017816-3991d580-d382-11eb-93e7-4c15bf340be7.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).