Summary: | Screen layout is scrambled after switching between X11 and Wayland Plasma session | ||
---|---|---|---|
Product: | [Plasma] KScreen | Reporter: | Vlad Zahorodnii <vlad.zahorodnii> |
Component: | common | Assignee: | kscreen-bugs-null <kscreen-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | 9luty1992, admin, alex765, ashark, butirsky, guido-kdebugs, katyaberezyaka, kman, lrdarknesss, michele.kipiel, nate, sitter, vityas_official |
Priority: | NOR | ||
Version: | git | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=433460 | ||
Latest Commit: | Version Fixed In: | 5.27 | |
Sentry Crash Report: | |||
Attachments: | Screenshots of the messed-up screen layout |
Description
Vlad Zahorodnii
2020-11-17 11:12:52 UTC
Related to Bug 433460. Once that's fixed, it would be interesting to see what's still broken. *** Bug 438423 has been marked as a duplicate of this bug. *** *** Bug 438132 has been marked as a duplicate of this bug. *** I have: output scale=1.5 in wayland. I switch to x11 globalscale=1. What I then see is that systemsettings(36246)/(default) KScreen::Output::geometry: logicalsize QSize(2560, 1440) dptr size QSize(3840, 2160) where logical size /1.5 of the real resolution systemsettings(36246)/(default) KScreen::Output::logicalSize: scale 1.5 What I believe happens here is that since wayland supports per-screen scaling the scale is recorded in the backing configs grep -ri 1.5 control/outputs/af15716759a8cd23110c74dd7f1fb852: "scale": 1.5 control/configs/db639558b75873b5ba72f206a3712a16: "scale": 1.5 but then on x11 per-screen isn't a thing so that's meaningless. BUT the Output class still reads the value and the KCM still uses the value to get relative sizing and whatnot. So this may indeed be the other side to the coin that is bug #433460 but I don't really have sufficient overview of the stack. It occurs to me that if libkscreen's Output class correctly dealt with scaling behind the scenes (that is to say: use the global config when in x11 or per-display in wayland) then everything built on top should work. I don't have scaling. My widgets and desktop are just swapped. For example on X11 i have Left and Right monitors. When i start wayland session, arrangement is correct, but X11 Right monitor contents are on Left monitor and vice-versa. Created attachment 139537 [details] Screenshots of the messed-up screen layout Same here: after setting per-screen scaling in Wayland and then switching back to X11 (because of https://bugs.kde.org/show_bug.cgi?id=438313 ) my screen setup is effed up (see attachment) Yes. That is entirely consistent with what we see in the two bug reports. What goes on in your screenshot is that the KCM thinks you are at a scale >1 so it takes the the actual resolution of your left hand screen and divides it by the scale. This then is the "logical" resolution that is smaller than your actual resolution. Say your left screen is 15x15 and has 1.5 scale. The logical size is 10x10. And that is the basis for the layout in the KCM preview. That is why it looks smart there (it behaves as though you were still in wayland). Kscreen then has the config first screen at point 0,0 with width=10 and height=10. second screen at point 11,11 width=5 and height=5 (random example values). Plasmashell (or KWin, unsure about responsibilities) on the other hand knows that you are on x11 and so wayland scale has no impact. The first desktop consequently gets rendered at 0,0 with width=15 and height=15 (these are the unscaled values!). Then it renders the second screen. KScreen says the second screen is at position 11,11. Plasma draws the desktop at that location with a width=5 and height=5. The second screen is now drawn on your first screen because the KScreen position was wrong. Hope that makes some sense. Essentially the KCM pretends you have wayland scaling, but you really don't so the positioning between KCM (scaled) and real world (not scaled) are out of sync and that results in things getting placed and incorrect locations. This bug was not fixed https://bugs.kde.org/show_bug.cgi?id=426496 Just check screenshots (they are not attached, only links), exact same issue. On X11 Intel, it swaps monitor content right after start. On nvidia X11 it doesn't swap. Haven't tested with AMD. On wayland it doesn't swap desktop contents like on X11 Intel. *** This bug has been marked as a duplicate of bug 365865 *** Oops wrong thing, sorry. *** Bug 438423 has been marked as a duplicate of this bug. *** *** Bug 438132 has been marked as a duplicate of this bug. *** *** Bug 389661 has been marked as a duplicate of this bug. *** *** Bug 445092 has been marked as a duplicate of this bug. *** *** Bug 447359 has been marked as a duplicate of this bug. *** *** Bug 447085 has been marked as a duplicate of this bug. *** I can confirm that this is fixed with the big multiscreen changes for Plasma 5.27! |