Bug 360430 - kscreen randomly rewrites screen configuration
Summary: kscreen randomly rewrites screen configuration
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.5.95
Platform: Exherbo Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-12 09:21 UTC by Bernd Steinhauser
Modified: 2022-11-08 21:11 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screen configuration (1.45 KB, text/plain)
2016-03-12 09:31 UTC, Bernd Steinhauser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Steinhauser 2016-03-12 09:21:17 UTC
I've seen this a lot since 5.5.95. I'm not sure if I saw it before, if so then it happened only rarely.

I have a screen configuration with three screens. I will attach it to the bug.
The x positions of the screens should be 0, 1920 and 3840 and are correctly assigned in the config file.
At startup, all three screens are connected (seeing the sddm login screen on all three).
After login, I'm presented with a clone setup and find in the file above the x position 0, 0 and 0.
If I disconnect one of the screens (thus a different config file gets loaded), change the file so the correct x positions are in there and reconnect the screen, the file is loaded as it should and the correct screen setup is done.

The only messages in journal I could find are:
Mar 12 10:02:14 orionis kscreen_backend_launcher[1119]: kscreen.xrandr: Connected output 83 to CRTC 79
Mar 12 10:02:14 orionis kscreen_backend_launcher[1119]: kscreen.xrandr: Connected output 85 to CRTC 80
Mar 12 10:02:14 orionis kscreen_backend_launcher[1119]: kscreen.xrandr: Connected output 86 to CRTC 81
Mar 12 10:02:14 orionis kscreen_backend_launcher[1119]: kscreen.xcb.helper: Detected XRandR 1.4
Mar 12 10:02:14 orionis kscreen_backend_launcher[1119]: kscreen.xcb.helper: Event Base:  88
Mar 12 10:02:14 orionis kscreen_backend_launcher[1119]: kscreen.xcb.helper: Event Error:  145

Then there are some detail messages about the connected screens (layout, rotation etc.), but nothing interesting there.
Interesting part is that I can't find something in the logs about loading or saving a screen configuration, but this must have happened since the config file was changed.
IIRC, the respective log lines should come from kded5 or kdeinit5.

Reproducible: Always
Comment 1 Bernd Steinhauser 2016-03-12 09:31:52 UTC
Created attachment 97851 [details]
screen configuration
Comment 2 lutz.wrage 2016-03-15 12:21:56 UTC
I have a similar problem with a configuration for laptop screen plus external monitor. The offset of the laptop screen should be (1920, 2160) but is sometimes reset to (0,0). I've seen this with all plasma 5.x.y versions that I've used so far.
As a workaround I use incrond to run a script that restores the kscreen configuration file whenever it changes.
Comment 3 Bernd Steinhauser 2016-03-19 10:41:48 UTC
It's easier to remove write access to the file, but that still does not solve the problem at all.
Comment 4 lutz.wrage 2016-03-19 15:19:07 UTC
With icrond's logging I was hoping to see a pattern when this occurs, but I couldn't find anything. It seems more or less random.
Comment 5 Bernd Steinhauser 2016-03-19 17:05:50 UTC
As I don't see this every time, I guess there is a race going on.

To me, it looks like kscreen tries to look for a config, when some daemon or backend is sometimes not available to retrieve the config (e.g. kded or kdeinit).
Then it tries a best guess at the screen config and writes that config to disk (at that time, the backend/daemon/whatever would be available, because it happens a bit later).

Since I'm not good at understanding c++ and since I don't know kscreen in detail, that's just speculation.
However, I remember from times where loading a config was successful, that there are lines in the log telling you that it found a config and tries to apply that.
When the config gets rewritten, I can't find such lines in the log, but there aren't logs about something failing either. Other than the lines about some xrandr, but iirc that's normal (since there are multiple ones).
Comment 6 Jimmy Berry 2016-05-21 23:07:38 UTC
Not sure if related although it seems likely, but my 3 screen config seems to be lost each login (since qt 5.6) and is a joke to setup again with kscreen5. Video demonstration: https://www.youtube.com/watch?v=GWC_SrE9cco.

Let me know if I should file separate bug.

My 3 screens are correct at login manager, but on login the left and right (identical screens) are cloned and center screen is disabled.
Comment 7 Bernd Steinhauser 2020-06-12 09:44:20 UTC
I didn't have this anymore for quite some time, so might close this as resolved (one way or another).
Comment 8 Nate Graham 2022-11-08 21:11:46 UTC
Thanks for following up!