Bug 477740

Summary: [Wayland] GTK3 menus activated with a click-and-hold do not highlight or activate child items
Product: [Plasma] kwin Reporter: dudesuchamazing
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: code, dennis.lissov, f-kde, julien.dlq, lilydjwg, nate, postix, xaver.hugl
Priority: NOR Keywords: usability, wayland-only
Version First Reported In: 5.27.8   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Menus when holding left mouse button

Description dudesuchamazing 2023-11-29 23:56:20 UTC
Created attachment 163625 [details]
Menus when holding left mouse button

SUMMARY

If the left mouse button is pressed down (in a menu bar, for example), a context menu will show up. 
With the mouse button still pressed, hovering over menu items should highlight them.
Releasing the mouse button over highlighted menu items should activate them.

This doesn't work on KDE Plasma Wayland session.

Works on X11, in Gnome, Weston, and in other OS'es.

STEPS TO REPRODUCE
1. Launch "GDK_BACKEND=wayland gtk3-demo"
2. Run "Menus" demo
3. Press and hold left mouse button over one of the menu bar items
4. The menu appears, but try to hover over its items - it's not interactive

OBSERVED RESULT
Menu items are not interactive

EXPECTED RESULT
Menu items can be highlighted when hovering over them with the mouse button held down, and activated when releasing the mouse button.

SOFTWARE/OS VERSIONS
Distro: Ubuntu 23.10
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Comment 1 dudesuchamazing 2023-11-30 00:47:04 UTC
This is one of the blockers for native Wayland support in KiCad: disambiguation menu is activated by long mouse button press and hold, which isn't interactive due to this bug.

Also reported in wxWidgets: https://github.com/wxWidgets/wxWidgets/issues/23942
Comment 2 Nate Graham 2023-11-30 19:28:41 UTC
Can reproduce. Does work with `GDK_BACKEND=x11 gtk3-demo`
Comment 3 Zamundaaa 2025-03-17 23:10:04 UTC
The reason this works on other compositors is that they send a wl_pointer.leave event on the parent window surface, and an enter event for the popup. KWin instead sees that the parent window surface has an implicit pointer grab (buttons are pressed) and blocks passing pointer focus to other surfaces.

How this works with Qt applications is that Qt has special logic to send pointer events to the correct surface... bad news though is that fixing this breaks Qt's assumptions about implicit grabs, and thus breaks the exact same feature there.
Comment 4 Bug Janitor Service 2025-03-17 23:22:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7359