Bug 470742 - Display scale resets to auto-calculated default values under certain circumstances
Summary: Display scale resets to auto-calculated default values under certain circumst...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: master
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-06-07 11:05 UTC by Nicolas Fella
Modified: 2023-07-21 03:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2023-06-07 11:05:57 UTC
I have a single laptop screen with 100% scaling. Sometimes the scaling automatically changes to 125%. I can reset it in systemsettings, but it will change again at a later point.

There seem to be at least two situations where this happens:
- When waking the laptop up from sleep. This happens only sometimes
- When using the recordme example from kpipewire and clicking "Add Virtual Monitor". This happens every time

kwin f4d88e79f7c48a527ec958ee2a65c2cee60adbfe
Qt 6.5.1
Comment 1 Nate Graham 2023-06-07 18:48:05 UTC
Is 125% the auto-calculated value for your screen's physical size and resolution? If so it sounds like the generator is inappropriately re-running when it should instead be reading the existing settings.

Possibly related to KWin eating KScreen in Plasma 6.
Comment 2 Nate Graham 2023-06-08 01:35:41 UTC
I just experienced this after waking my laptop from sleep in a Plasma 6 Wayland session.

I assume you were on Wayland too? I've never seen this in the Plasma 6 X11 session, which I had been using regularly until today.
Comment 3 Nicolas Fella 2023-06-08 10:28:53 UTC
> Is 125% the auto-calculated value for your screen's physical size and resolution? If so it sounds like the generator is inappropriately re-running when it should instead be reading the existing settings.

It is not, or it shouldn't be anyway. This is a 14" 1080p screen, 100% is the appropriate scaling
Comment 5 Nate Graham 2023-06-08 21:43:16 UTC
This is happening to me 100% reproducibly after waking from sleep.

I have a hunch that a number of "changed settings not remembered" bugs may be related. We have quite a few now. See:
- Bug 470345
- Bug 470574
- Bug 470604

Maybe there's a KConfig regression somewhere?
Comment 6 Zamundaaa 2023-06-09 19:32:14 UTC
KScreen doesn't use KConfig, most likely the config generator in KWin runs when it shouldn't. Can you put a debug print into https://invent.kde.org/plasma/kwin/-/blob/80b7ed62da1b1c3dd9ff1f531b9d9637cb1b7522/src/outputconfigurationstore.cpp#L33 and see if that's the case?
Comment 7 Nicolas Fella 2023-06-11 15:41:05 UTC
> In fact it is; see https://invent.kde.org/plasma/kscreen/-/blame/master/tests/kded/configs/AutogeneratedLaptopScreenScales.json#L32-L53

well that's not great, 125% is too large for this screen
Comment 8 Nate Graham 2023-06-12 14:17:52 UTC
Screen scaling can be a matter of preference, which is why it's configurable; that's simply the default auto-calculated value that we reason ought to be sane for an average person. If you think the default scale calculation is sub-optimal for an average person, feel free to look through the code in generator.cpp that explains why we do it this way, and propose a change that remains faithful to human-biology-based reasoning in principle, and also adjust the autotests.
Comment 9 David Edmundson 2023-06-13 12:56:12 UTC
I could reproduce this reliably, however after an update to fix an ABI issue in kscreen and a good clean reboot it no longer appears to be the case.

Nico can you confirm if it's still an issue?
Comment 10 Nicolas Fella 2023-06-13 19:20:30 UTC
Still happening with the virtual monitor thing in recordme
Comment 11 Zamundaaa 2023-06-13 20:59:44 UTC
While it's not great, that one is expected. When there's no existing config for a given combination of outputs, KScreen generates a completely new config from scratch. The current logic in KWin does the same too.
Comment 12 Nicolas Fella 2023-06-14 10:07:48 UTC
It just happened again on wakeup
Comment 13 Nate Graham 2023-06-21 05:03:18 UTC
This is 100% reproducible for me when closing my laptop lid. OutputConfigurationStore::generateConfig() actually gets called before the system goes to sleep, according to journal logs:

Jun 20 23:14:19 Liberator systemd-logind[911]: Lid closed.
Jun 20 23:14:19 Liberator kwin_wayland[1513]: OutputConfigurationStore::generateConfig was called with outputs: QList(KWin::DrmOutput(0x16a31e0, name="eDP-1", geometry=QRect(0,0 1920x1080), scale=2)) and is lid closed? true
Jun 20 23:14:19 Liberator systemd-logind[911]: The system will suspend now!
Jun 20 23:14:19 Liberator ModemManager[1034]: <info>  [sleep-monitor-systemd] system is about to suspend
Jun 20 23:14:19 Liberator NetworkManager[858]: <info>  [1687295659.7941] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Jun 20 23:14:19 Liberator NetworkManager[858]: <info>  [1687295659.7948] device (p2p-dev-wlp0s20f3): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Jun 20 23:14:19 Liberator NetworkManager[858]: <info>  [1687295659.7952] manager: NetworkManager state is now ASLEEP
Comment 14 Nate Graham 2023-06-21 08:56:03 UTC
For me, this has been fixed by the fix for Bug 471282. Can you confirm that, Nico?
Comment 15 Bug Janitor Service 2023-07-06 03:45:18 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 16 Bug Janitor Service 2023-07-21 03:45:13 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!