Bug 479989

Summary: The popup menu of Xwayland window cannot close by clicking on the title bar
Product: [Plasma] kwin Reporter: Jie Liu <liujie01>
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: agurenko, kde
Priority: NOR Keywords: qt6
Version First Reported In: master   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.