Bug 418453

Summary: Menu popups are misplaced
Product: [Plasma] kwin Reporter: Jan Grulich <jgrulich>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: jgrulich, kde
Priority: NOR    
Version First Reported In: 5.18.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot of the issue
Wayland debug output
Output from env
KWin output

Description Jan Grulich 2020-03-04 07:16:31 UTC
Created attachment 126584 [details]
Screenshot of the issue

SUMMARY
Opening any menu from the top menubar makes the popup to appear completely off.

STEPS TO REPRODUCE
1. Open any application
2. Click on any menu in the menubar
3. Observe the popup'ed menu is completely off

OBSERVED RESULT
Menu is completely off.

EXPECTED RESULT
Menu is placed at the correct location.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 31 
(available in About System)
KDE Plasma Version: Plasma 5.18.2
KDE Frameworks Version: 5.67
Qt Version: 5.13.2

ADDITIONAL INFORMATION
I use 125% scaling on my QHD monitor. On my 4k monitor where I use 200% scaling the menu is not completely off, but it is few pixel below the correct place. On the other hand when I disable scaling on the QHD monitor it doesn't make any difference. Context menus are placed correctly.

I think I have been experiencing this even with Plasma 5.17.5 so it might not be related to the Plasma update.
Comment 1 Vlad Zahorodnii 2020-03-04 08:09:11 UTC
Hmm, I cannot reproduce this bug. Can you please run kcalc with WAYLAND_DEBUG=1 and post the output here?
Comment 2 Jan Grulich 2020-03-04 08:53:39 UTC
Created attachment 126587 [details]
Wayland debug output
Comment 3 Vlad Zahorodnii 2020-03-04 10:34:15 UTC
-> xdg_positioner@56.set_anchor_rect(1920, 29, 1, 1)

This one doesn't seem right. Could it be a Qt issue?
Comment 4 David Edmundson 2020-03-04 10:37:45 UTC
Can I see output of "env" please.
Comment 5 Jan Grulich 2020-03-04 10:40:42 UTC
Created attachment 126588 [details]
Output from env

Sure thing.
Comment 6 David Edmundson 2020-03-04 13:40:54 UTC
There's another part that doesn't look right:

[2329466,137] zxdg_output_v1@13.logical_position(0, 60)
[2329466,147] zxdg_output_v1@13.logical_size(1920, 1080)
[2329466,155] zxdg_output_v1@13.done()

[2329467,246] zxdg_output_v1@17.logical_position(3968, 0)
[2329467,257] zxdg_output_v1@17.logical_size(2048, 1152)
[2329467,267] zxdg_output_v1@17.done()

The second output logical position should be 1920. Lets fix that and then go from there.

If we give garbage screen data to Qt I can imagine it doing something weird as menu positions get mapped to a global pos, constrained and then get mapped to a relative one.
Comment 7 Vlad Zahorodnii 2020-03-04 13:52:39 UTC
(In reply to David Edmundson from comment #6)
> There's another part that doesn't look right:
> 
> [2329466,137] zxdg_output_v1@13.logical_position(0, 60)
> [2329466,147] zxdg_output_v1@13.logical_size(1920, 1080)
> [2329466,155] zxdg_output_v1@13.done()
> 
> [2329467,246] zxdg_output_v1@17.logical_position(3968, 0)
> [2329467,257] zxdg_output_v1@17.logical_size(2048, 1152)
> [2329467,267] zxdg_output_v1@17.done()

Well, it's more like

[2329466,137] zxdg_output_v1@13.logical_position(0, 60)
[2329466,147] zxdg_output_v1@13.logical_size(1920, 1080)
[2329466,155] zxdg_output_v1@13.done()

[2329466,686] zxdg_output_v1@15.logical_position(1920, 0)
[2329466,693] zxdg_output_v1@15.logical_size(2048, 1152)
[2329466,702] zxdg_output_v1@15.done()

[2329467,246] zxdg_output_v1@17.logical_position(3968, 0)
[2329467,257] zxdg_output_v1@17.logical_size(2048, 1152)
[2329467,267] zxdg_output_v1@17.done()
Comment 8 Vlad Zahorodnii 2020-03-04 13:53:07 UTC
@Jan can you please post output of `qdbus org.kde.KWin /KWin supportInformation`?
Comment 9 Jan Grulich 2020-03-04 14:13:52 UTC
Created attachment 126597 [details]
KWin output
Comment 10 Jan Grulich 2020-03-05 06:14:03 UTC
Problem solved. I cannot explain what happened, but I also started experiencing Yakuake not using fully my monitor or showing across two monitors and sometimes after I logged in, my Plasma configuration was broken, displays were not placed next to each other or panel was placed on a wrong one etc. I decided to wipe all KScreen and Plasma configuration, because I have been carrying it for a long time and configured everything from scratch and after that I canot reproduce this issue and Yakuake also behaves as before.
Comment 11 Jan Grulich 2020-03-05 06:15:11 UTC
I will close this bug for now and reopen if it happens again.