Bug 441417

Summary: Monitor layout and dimensions don't match resolution when using scaling
Product: [Applications] systemsettings Reporter: Heinz Wiesinger <pprkut>
Component: kcm_kscreenAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: ach, jlp, kde, makosol, meven29, nate, philipp.reichmuth, plasma-bugs
Priority: NOR Keywords: usability
Version: 5.22.4   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In: 5.24
Attachments: Screenshot
Screenshot with laptop screen configuration

Description Heinz Wiesinger 2021-08-23 09:23:15 UTC
Created attachment 140971 [details]
Screenshot

SUMMARY

I have a laptop with an internal 4k screen, and an external 4k monitor attached via USB-C. Both have the same 4k resolution configured, but the systemsettings module shows screen sizes and layout not in the way it's actually configured. Also, the pager applet shows screen sizes in another different way that doesn't match either the actual configuration nor what systemsettings shows.

STEPS TO REPRODUCE
1. Open systemsettings
2. Attach screen

OBSERVED RESULT

External screen is placed correctly at 3840,0. Internal screen uses 4k resolution, but system settings shows it's using 1920x1080.
The Pager shows the internal display as much wider than the external one.

EXPECTED RESULT

Display resolution and layout that systemsettings shows should match the actual configuration.
Pager should show display layout matching the actual configuration.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

It's possible the pager issue is a separate bug, but since it's also related to the display layout it might come from the same source. I can open a separate bug report if needed.
Comment 1 Heinz Wiesinger 2021-08-23 09:25:44 UTC
Created attachment 140972 [details]
Screenshot with laptop screen configuration

Better screenshot that actually shows the laptop screen configuration
Comment 2 Nate Graham 2021-11-23 22:46:32 UTC
*** Bug 445757 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2021-11-23 22:47:14 UTC
*** Bug 442090 has been marked as a duplicate of this bug. ***
Comment 4 David Edmundson 2021-11-24 12:09:43 UTC
The description is quite confused, but there is an underlying bug which I assume is what the commenter is talking about.

We have a behavioural difference between X and wayland. On wayland we store the scale per screen.
We also want to show the logical size, not the resolution, so Output::logicalSize() returns resolution/scale.
This is 100% completely correct. 

However, if you go back into X we have a mishmash. We don't support per-output scaling so the logicalSize should match the resolution, but because it's saved per output Output::logicalSize returns something that makes no sense and we get this gap.

Ideally Output::logicalSize should check which platform it's under and not include the scale part when running on X, but it's not trivial to do that nicely.
Comment 5 David Edmundson 2021-11-24 12:11:23 UTC
Related: https://invent.kde.org/plasma/kscreen/-/merge_requests/26

Which sort of does it at the wrong layer, but I also can't think of anything better.
Comment 6 Heinz Wiesinger 2021-11-24 12:41:35 UTC
I sort of get the explanation, but wouldn't that then be the case for both the internal *and* the external screen? Both of them are 4k for me and both of them have a scale factor of 2, yet only one of them is showing as different in systemsettings.
Comment 7 Heinz Wiesinger 2021-11-24 14:20:10 UTC
Oh, I think I get it now. I did log into a wayland session a couple times before I got my external screen, but not since then.

So if I understood the merge request correctly, the resolution preview is wrong for the internal screen because *that* one was used in a wayland session, but it's not wrong for the external screen because it wasn't used in a wayland session yet. I suppose that would make sense.
Comment 8 phrxmd 2021-11-24 15:51:24 UTC
(In reply to Nate Graham from comment #2)
> *** Bug 445757 has been marked as a duplicate of this bug. ***

I'm not sure that bug 445757 is actually a duplicate. This bug seems to be about logical sizes being calculated wrong, while bug 445757 is about the confusing display of resolutions in the pager applet in principle - the physical resolution is not shown, so users see the logical size and think that it's the physical resolution and that their display is not used at its full capability.
Comment 9 Bug Janitor Service 2021-11-29 16:18:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreen/-/merge_requests/57
Comment 10 Méven Car 2021-11-30 14:47:28 UTC
*** Bug 446178 has been marked as a duplicate of this bug. ***
Comment 11 Méven Car 2021-12-02 16:05:32 UTC
Git commit 4d025b68022405ce889b563ed67646ccbfe4a658 by Méven Car.
Committed on 01/12/2021 at 16:54.
Pushed by meven into branch 'master'.

Compute logicalSize taking into account current config

M  +1    -1    kcm/output_identifier.cpp
M  +15   -8    kcm/output_model.cpp
M  +2    -2    kded/output.cpp

https://invent.kde.org/plasma/kscreen/commit/4d025b68022405ce889b563ed67646ccbfe4a658
Comment 12 Heinz Wiesinger 2021-12-05 11:47:39 UTC
I can confirm that the patch fixes the screen resolution reporting in systemsettings. However, the pager issue remains, so that looks like a different bug. Will file a new one for that separately.
Comment 13 Nate Graham 2021-12-07 03:25:10 UTC
*** Bug 446508 has been marked as a duplicate of this bug. ***
Comment 14 Méven Car 2021-12-15 15:39:54 UTC
(In reply to Heinz Wiesinger from comment #12)
> I can confirm that the patch fixes the screen resolution reporting in
> systemsettings. However, the pager issue remains, so that looks like a
> different bug. Will file a new one for that separately.

Yes it is a plasma-destkop / plasma-workspace issue.