Bug 480281 - (Wayland) GTK Appmenus exhibit erratic / incorrect behavior on tablet device
Summary: (Wayland) GTK Appmenus exhibit erratic / incorrect behavior on tablet device
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.10
Platform: NixOS Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-24 17:11 UTC by Naxdy
Modified: 2024-02-08 08:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Naxdy 2024-01-24 17:11:13 UTC
SUMMARY
Not sure, if this is even a kwin bug, or something else. But on my tablet device, when logged into the regular Plasma (Wayland) session, the appmenu of most GTK apps is broken in an awkward way, in that no matter where the appmenu is clicked, the click is always registered on the leftmost item.

This is not a huge issue when using a mouse, as hovering over a different item will select it, but when using the touchscreen, this essentially renders GTK appmenus completely unusable (there is a way to focus the correct item with some wizard-like finger movements, but it's incredibly unintuitive and cumbersome).

Note that this issue does NOT appear when window decorations are disabled via:
[org.kde.kdecoration2]
NoPlugin=true

As is the default for the mobile session (thus, in the mobile session, these appmenus work just fine).

When messing around with the appmenu, the affected app (I used gscan2pdf) spams this in the user journal:
Jan 24 17:42:43 nxtab ..gscan2pdf-wra[4552]: Tried to map a popup with a non-top most parent

STEPS TO REPRODUCE
Sorry, no idea. I'd say get a Microsoft Surface Go 3, install Plasma on it, and give it a try, but this doesn't seem viable.

Disabling the touch screen, changing screen orientation, and display scaling doesn't affect this issue however. The only thing that "fixes" it, is disabling window decorations entirely and forcing GTK apps to use CSDs.

OBSERVED RESULT
Appmenu click is always registered in the top left corner first (presumably)

EXPECTED RESULT
Appmenu click is registered at the position of the mouse cursor / touch

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS
(available in About System)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12

ADDITIONAL INFORMATION
Since this may be difficult to reproduce due to potentially being hardware specific, I'm happy to test any patches or config changes thrown my way.
Comment 1 Naxdy 2024-01-24 17:13:39 UTC
Uploaded a demo of the bug using a mouse: https://cloud.polskalemon.com/s/teHtPcLJzxdJH68
Comment 2 Nicolas Fella 2024-01-24 22:50:08 UTC
For me the menu bar in gscan2pdf is a bit weird when using a touchscreen (sometimes I need to click two times on the menu bar for it to do things), but I'm not seeing what you are describing. Not on Plasma 5, 6, or Gnome
Comment 3 Naxdy 2024-01-25 11:38:09 UTC
Do you also get "Tried to map a popup with a non-top most parent" in your log?

As a side note, this only affects GTK apps running under native Wayland. If I force them to run under Xwayland (via GDK_BACKEND=x11), this issue does not present itself.
Comment 4 Nicolas Fella 2024-01-25 12:31:14 UTC
> Do you also get "Tried to map a popup with a non-top most parent" in your log?

yes, and it correlates to the menu being weird. I have also seen it on Gnome
Comment 5 Naxdy 2024-01-25 12:32:53 UTC
Could be upstream GTK then, I will switch my device over to GNOME this weekend and report back.
Comment 6 Naxdy 2024-02-08 08:37:34 UTC
Sorry for the long wait. Had a chance to test it on GNOME, and there it works for me as well. Not a surprise though, given that GNOME enforces CSDs, and when used under the plasma mobile shell (which also has CSDs enabled for GTK apps) it also works.

I'll wait until Plasma 6 is out and re-test in both the mobile shell and regular plasma shell, and report back.