Bug 492917 - KWin Right click Context menu can be moved outside of the Window while window is moved using Meta key on Wayland
Summary: KWin Right click Context menu can be moved outside of the Window while window...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.1.4
Platform: Arch Linux Linux
: LO minor
Target Milestone: ---
Assignee: KWin default assignee
URL: https://bugreports.qt.io/browse/QTBUG...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-09 20:57 UTC by reports_go_brrr
Modified: 2024-09-23 17:24 UTC (History)
2 users (show)

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


Attachments
Wayland issue (908.27 KB, video/mp4)
2024-09-09 20:57 UTC, reports_go_brrr
Details
X11 proper functioning (549.15 KB, video/mp4)
2024-09-09 20:58 UTC, reports_go_brrr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description reports_go_brrr 2024-09-09 20:57:20 UTC
Created attachment 173503 [details]
Wayland issue

SUMMARY
Context Menu under Wayland can just stay still if window is being transformed by Meta key, althought X11 session after only clicking with pressed Meta key or without it closes Context Menu immediately.
I can reproduce the same in LibreOffice, Firefox, KWrite, Ark, Konsole...

STEPS TO REPRODUCE
1. Open any of apps above.
2. Right click and call any Context Menu to show up.
3. Press Meta key and by Right Click resize the window to make it smaller
4. Move the window by Left Click to hold it.

OBSERVED RESULT
How you can move ContextMenu outside of screen.

EXPECTED RESULT
Honestly, to save it's position proportionally according to screen size and move it capturing that point. Not forgeting screen corners restrictions to not to make it fly too far.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.7-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Vanilla KDE Plasma, vanilla Dolphin, vanilla EndeavourOS.
Comment 1 reports_go_brrr 2024-09-09 20:58:39 UTC
Created attachment 173504 [details]
X11 proper functioning
Comment 2 cwo 2024-09-12 20:53:50 UTC
Can confirm the steps work as described; I was able to move a  context menu completely outside the window borders, then out of the screen area.

A slightly different and maybe simpler setup works as well: have an unmaximized , small window, maximize it, right-click in an area that the unmaximized window did not cover, then move the window with Meta+left-click drag. It will unmaximize, but the context menu will stay in its position, and you can immediately push the context menu outside the screen by continuing to move the window.
Comment 3 Vlad Zahorodnii 2024-09-23 09:09:48 UTC
It works as expected, unfortunately. Qt creates non-reactive popups by default, meaning that kwin must not unconstrain them if they are outside the work area. This is, sort of, caused by missing xdg-positioner type in Qt. (although maybe qtwayland could create reactive popups by default?)
Comment 4 reports_go_brrr 2024-09-23 16:59:20 UTC
(In reply to Vlad Zahorodnii from comment #3)
> It works as expected, unfortunately. Qt creates non-reactive popups by
> default, meaning that kwin must not unconstrain them if they are outside the
> work area. This is, sort of, caused by missing xdg-positioner type in Qt.
> (although maybe qtwayland could create reactive popups by default?)

So if they'll fix it will it bring the parity between X11 and Wayland for this bug?
Comment 5 Vlad Zahorodnii 2024-09-23 17:24:40 UTC
Yeah, maybe QtWayland should create reactive popups by default too, in which case we don't need to wait for the new api. But as is, kwin does as mandated by the xdg-shell spec