Bug 490590 - Menu items on some Electron applications like VS Code are not working on Wayland
Summary: Menu items on some Electron applications like VS Code are not working on Wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: appmenu (show other bugs)
Version: 6.1.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2024-07-21 03:57 UTC by TYY331
Modified: 2024-08-03 03:45 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TYY331 2024-07-21 03:57:08 UTC
SUMMARY
on Wayland, some Electron applications like VS Code and Postman correcly export their menu items but clicking on them doesn't trigger any action, this only happens with the application menu window decoration button, the plasma widget works as expected.

STEPS TO REPRODUCE
1. enable application menu button on window decoration
2. Open an Electron application like VS Code
3. click on any menu entry (like new file for example)

OBSERVED RESULT
The application doesn't register any input, other electron applications like Boostnote works as expected, so this probably has to do with the Electron version being used.

EXPECTED RESULT
Menu items correctly trigger the action when clicked.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2024-07-26 10:53:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4558
Comment 2 David Redondo 2024-08-02 07:50:47 UTC
Git commit b5db1d7e38fcb1184b2e8df923cf3648c3a6d0c3 by David Redondo.
Committed on 02/08/2024 at 07:09.
Pushed by davidre into branch 'master'.

Improve titlebar appmenu on Wayland

Until now the first level menu was a toplevel, the second level
proper popups. While visually working this design had two major
issues. The UX is different comapred to what is expected and to
normal menus and more importantly the toplevel takes focus away
from the app window which causes some apps to not react to triggered
actions anymore.
This patch uses an invisible toplevel window to serve as parent
for the menu which makes it act exactly the same as a normal menu
would. In addition it is made to not take focus via the plasmashell
protocol. (Making the first level menu toplevel not take focus in the
previous design wouldnt work because it  breaks the UX even more as
arrow keys and accelerators wouldn't work anymore.)
This also changes the way we inject fake serials to QtWayland because
they are now needed for the first level of the menu. While before
the enter serial to the first menu was used, now a fake one is set
(any only if noone was ever set). But this doesn't change really
anything as while before it was still some kind of serial it was one
of the wrong kind not referring to an implicit grab as is expected
when creating a grabbing popup.

M  +39   -24   appmenu/appmenu.cpp
M  +1    -2    appmenu/appmenu.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/b5db1d7e38fcb1184b2e8df923cf3648c3a6d0c3