Bug 479989 - The popup menu of Xwayland window cannot close by clicking on the title bar
Summary: The popup menu of Xwayland window cannot close by clicking on the title bar
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: master
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-01-18 13:15 UTC by Jie Liu
Modified: 2024-02-22 15:04 UTC (History)
2 users (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 Jie Liu 2024-01-18 13:15:38 UTC
SUMMARY
***
Xwayland popup menu will close if its mainwindow deactivate or click on the area outside of the popup menu but inside of the mainwindow. If we click on title bar the xwayland window can't recieve the mouse click event and it is still active, so its popup menu doesn't close.

This causes the popup menu to detach from the main window position when we drag the xwayland window.

Qt popup menu, gtk popup menu and some browser menu all have this issue.
***


STEPS TO REPRODUCE
1. Open a xwayland window with popup menu;
2. Open the popup menu;
3. Clicked on the title bar of the xwayland window.

OBSERVED RESULT

The popup menu will still be open.

EXPECTED RESULT

The popup menu auto closed.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Xwayland window with popup menu.
(available in About System)
KDE Plasma Version: Plasma 6 Beta 2
KDE Frameworks Version: 
Qt Version: 6.6.0

ADDITIONAL INFORMATION
Comment 1 David Edmundson 2024-02-22 15:04:56 UTC
This is not feasible. The limitations of x are that popups have exclusive grabs. We have to emulate that as best as possible by sending the input to X. Any hack we could do has risks of regression elsewhere.