Bug 388218 - Desktop scaling is applied twice in Scale Display preview
Summary: Desktop scaling is applied twice in Scale Display preview
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: kcm (show other bugs)
Version: 5.10.5
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-25 16:01 UTC by Lastique
Modified: 2018-07-24 19:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Konsole window with two undrawn lines (50.37 KB, image/png)
2017-12-25 16:17 UTC, Lastique
Details
Logs collected for scale ratio 1.0 and 1.7 (13.32 KB, application/gzip)
2018-01-23 01:13 UTC, Lastique
Details
Scaling dialog when system is booted with ratio 1.7 and the ratio is 1.7 (161.38 KB, image/png)
2018-01-23 01:17 UTC, Lastique
Details
Scaling dialog when system is booted with ratio 1.7 and the ratio is 1.7 (240.40 KB, image/png)
2018-01-23 01:18 UTC, Lastique
Details
Scaling dialog when system is booted with ratio 1.7 and the ratio is 1.0 (161.38 KB, image/png)
2018-01-23 01:21 UTC, Lastique
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lastique 2017-12-25 16:01:52 UTC
In System Settings -> Display and Monitor -> Scale Display dialog, the preview is scaled twice. Apparently, it is first rendered using the current scaling ratio that is in effect and then the rendered image is scaled using the selected scaling ratio. For example, if after reboot the scaling ration is 1.7 and you open this dialog, the preview will not show the current sizes of interface elements but instead scale them up 1.7x again (therefore the preview would show 1.7 * 1.7 = 2.89x scaling ratio).

The preview should show the actual size of UI elements after setting the specified scaling ratio.
Comment 1 Lastique 2017-12-25 16:17:49 UTC
Created attachment 109513 [details]
Konsole window with two undrawn lines

Here's a screenshot of Konsole with two undrawn horizontal lines (the lines show bits of desktop background behind Konsole window).

I've also noticed that similar undrawn lines appear under each line of the console as its contents change. For example, one can start mc (Midnight Commander) and try navigating filesystem; the corrupted lines will appear as mc modifies the console contents.
Comment 2 Lastique 2017-12-25 16:23:36 UTC
Sorry, ignore my last comment and attached screenshot. It was supposed to be posted to a different bug.
Comment 3 Nate Graham 2017-12-27 00:57:11 UTC
Can confirm. Pretty weird.
Comment 4 Sebastian Kügler 2018-01-09 11:43:45 UTC
I can't reproduce this on my system.

Could you post the info as outlined in https://community.kde.org/Solid/Projects/ScreenManagement#Debugging_Information here, so I can have a look at what's specific to your setup?
Comment 5 Christoph Feck 2018-01-22 23:12:40 UTC
If you can provide the information requested in comment #4, please add it.
Comment 6 Lastique 2018-01-23 01:13:51 UTC
Created attachment 110064 [details]
Logs collected for scale ratio 1.0 and 1.7

Here are the collected logs. After I enabled the logs I first booted the system with 1.0 scale ratio. You can find the collected logs and settings for this boot time in the 1.0 subfolder.

I started the kcm_shell and changed the scale ratio to 1.7 and then rebooted. Logs and settings from after that reboot are in the 1.7 subfolder. While booted with 1.7 scale ratio, I started kcm_shell again (the bug was apparent) and changed the scale ratio back to 1.0.
Comment 7 Lastique 2018-01-23 01:17:03 UTC
Created attachment 110065 [details]
Scaling dialog when system is booted with ratio 1.7 and the ratio is 1.7

Here is a screenshot taken from the system booted with scale ratio 1.7 and the scale ratio in the dialog is 1.7 too (i.e. unchanged since boot). You can see that the preview elements are noticeably larger than the rest of the interface.
Comment 8 Lastique 2018-01-23 01:18:31 UTC
Created attachment 110066 [details]
Scaling dialog when system is booted with ratio 1.7 and the ratio is 1.7
Comment 9 Lastique 2018-01-23 01:21:21 UTC
Created attachment 110067 [details]
Scaling dialog when system is booted with ratio 1.7 and the ratio is 1.0

And here is a screenshot from the system that is still booted with scale ratio 1.7 but the slider in the dialog have been moved to 1.0. Notice that the preview elements are roughly the same size as the rest of the UI (i.e. are actually 1.7 times larger than they would normally be with scale ratio 1.0).
Comment 10 David Edmundson 2018-07-24 19:14:21 UTC
Git commit 5c45d27f00b4207d5db347350a81e8ecb6bdb108 by David Edmundson.
Committed on 24/07/2018 at 19:13.
Pushed by davidedmundson into branch 'Plasma/5.12'.

Fix preview widget appearing to scale twice

Summary:
It worked when I wrote it against integer scaling, it got broken when
fractional support was added, resulting in it rendering at the wrong
size when the host scaling is non integer.

Test Plan:
Ran with QT_SCALE_FACTOR=1.5 to simulate the host being at that scale
Opened preview and moved slider
At 1.0 buttons were smaller than the main KCM
At 1.5 buttons looked the same
At 2.0 looked bigger

Reviewers: broulik

Reviewed By: broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14338

M  +1    -1    kcm/src/previewwidget.cpp

https://commits.kde.org/kscreen/5c45d27f00b4207d5db347350a81e8ecb6bdb108