Bug 442489

Summary: Context menu misaligned in Qt apps
Product: [Plasma] kwin Reporter: Jochen Fähnlein <jochen>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: ivan, jochen, kde, nate, plasma-bugs-null
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.22.4   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
URL: https://bugreports.qt.io/browse/QTBUG-68636
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot with dolphin and its context menu
Screenshot of context menu misalignment in Dolphin
Screenshot of context menu in separate window in Dolphin
Screenshot of context menu in separate window in Argos Translate

Description Jochen Fähnlein 2021-09-15 19:08:37 UTC
Created attachment 141573 [details]
Screenshot with dolphin and its context menu

With use of wayland nearly all context menus of KDE applications are misaligned to the cursor position.


STEPS TO REPRODUCE
1. Open e.g. kontact
2. click with right mouse button to open the context menu

The opened context menu is far away from the current cursor position.
A screenshot is attached.


SOFTWARE/OS VERSIONS

Operating System: Ubuntu 21.04
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.11.0-34-generic
OS Type: 64-bit
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 31.4 GiB of RAM
Graphics Processor: Radeon RX 570 Series

Displays: 2
- 0: Transformation: normal
- 1: Transformation: 90
Comment 1 Iván Ávalos 2021-09-18 19:33:10 UTC
I can confirm: it happens in all KDE applications when I'm using two monitors with different resolutions (1360x768 and 1920x1080) (not sure if it also happens with monitors of the same resolution).

There's also another bug: when you open a context menu in an unfocused KDE window, the context menu opens in a window in a corner of the monitor, which is weird. I attached the screenshots of the two bugs.

SOFTWARE/OS VERSIONS

Operating System: Parabola
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Kernel Version: 5.10.56-gnu-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620

Displays: 2
- 0: Transformation: normal
- 1: Transformation: normal
Comment 2 Iván Ávalos 2021-09-18 19:34:46 UTC
Created attachment 141685 [details]
Screenshot of context menu misalignment in Dolphin
Comment 3 Iván Ávalos 2021-09-18 19:35:29 UTC
Created attachment 141686 [details]
Screenshot of context menu in separate window in Dolphin
Comment 4 Iván Ávalos 2021-09-18 19:46:47 UTC
Created attachment 141687 [details]
Screenshot of context menu in separate window in Argos Translate

The issue does not only affect KDE apps, but also all Qt apps. Argos Translate is a non-KDE Qt application, and, as you can see in the screenshot, context menu for language selection is misaligned. The second bug I reported, regarding context menu opening in a separate window, doesn't seem to apply in this case.
Comment 5 Nate Graham 2021-09-20 17:08:08 UTC
This is an upstream Qt bug: https://bugreports.qt.io/browse/QTBUG-68636

Despite the title of that bug, it is not specific to apps run on GNOME; it affects Qt apps on Plasma too.
Comment 6 Iván Ávalos 2021-09-25 05:57:21 UTC
The issue has not been resolved on upstream's bug tracker. I don't think it's appropriate to set the status of this issue as “resolved upstream.” There doesn't seem to be an  “open upstream” status, though.
Comment 7 Nate Graham 2021-09-25 14:20:35 UTC
(In reply to Iván Ávalos from comment #6)
> The issue has not been resolved on upstream's bug tracker. I don't think
> it's appropriate to set the status of this issue as “resolved upstream.”
https://community.kde.org/Get_Involved/Issue_Reporting#Understand_what_the_resolution_statuses_mean