Bug 383260 - Resolution changes leak across X sessions
Summary: Resolution changes leak across X sessions
Status: RESOLVED UPSTREAM
Alias: None
Product: kde
Classification: I don't know
Component: xinerama (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: Lubos Lunak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-08 03:04 UTC by Neil Skrypuch
Modified: 2017-08-08 06:35 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Skrypuch 2017-08-08 03:04:35 UTC
For context, I have a triple monitor setup (3840x2160 center monitor with a 1600x1200 monitor rotated 90 degrees clockwise to the left and the right of the center monitor) all connected to a GTX 1080 Ti. In my xorg.conf is a static metamode (Nvidia style) describing this setup so that it's setup properly even if I'm not using KDE (SDDM, or a bare X session for example). This all works great and I've done something similar for many many years.

Now, due to the fact that I normally have a lot of windows open and I don't want them to be moved around or resized on me (as generally happens if the resolution is changed) if I do actually want to run something in a different resolution (mainly games, but also required for Gsync to work (as it only works with a single active monitor)), then I will start a second X session (:1) and switch *that* session's resolution, to guarantee that my primary X session (:0) remains untouched.

Today, I executed the second X session as described above (switching center monitor to 3840x2160 and the side monitors off via xrandr) and when I was done, I returned to my primary X session and discovered that my resolution had been changed (primary and right monitor were off, left monitor was the correct resolution but no longer rotated). Frustrated, I killed that X session and and let the static xorg.conf setup fix the resolution, which it did at the login manager (SDDM). However, immediately after starting KDE, I was returned to the broken resolution (left monitor not rotated, other two monitors off). At this point the only way to fix the setup was to manually open nvidia-settings, rotate my head 90 degrees and reenable the other two monitors and set the monitor rotations correctly (using the kscreen equivalent probably would work too - I didn't try, but ultimately not relevant). At this point, the correct resolution will persist across KDE logins as expected (until of course one tries to use a second X session again).

This issue is reproducible every time (with the same broken resolution on the primary X session), regardless of the resolution change that actually happened on the second X session. This started happening quite recently, no more than 6 months ago, but probably even less.

I'm not sure what specific component is at fault here, but I'm currently using plasma-5.34.0 and plasma-meta-5.9.5. In the past 6 months, plasma-meta was updated from 5.8.5 to 5.8.6 and then to 5.9.5, while plasma was updated from 5.29.0 to 5.34.0. I can provide further version details for other packages upon request.

In short, it appears that KDE is:
a) listening for all resolution changes (across all X sessions, not just the current X session nor just any X sessions with KDE running in them), and
b) attempting to update the resolution of a KDE session in response to a), and
c) failing badly at changing the resolution (probably because changing resolution of a non-active X session is generally a no-no), and
d) saving the broken resolution settings and persisting them into the next session, undoing the static xorg.conf config

I suspect the design intent here was to notice resolution changes in the current KDE session (even when they happen via xrandr and not through a KDE tool) and persist them across sessions (arguably a nice feature to have), but this should not pick up resolution changes in other X sessions (especially non-KDE X sessions).
Comment 1 Neil Skrypuch 2017-08-08 06:35:06 UTC
Actually, upon further testing, two things become apparent:

1) It's not the resolution change that's triggering the issue, it's the VT switch (to another X session... text mode is ok), and
2) updating from nvidia-drivers-384.47 to nvidia-drivers-384.59-r1 fixes the issue.

It was likely an nvidia-drivers bump in the past couple months that broke it (there were several in that time) in the first place, I just hadn't noticed yet.

KDE automagically saving the active resolution and reapplying it at login time is a new one on me, so I was initially barking up the wrong tree.

Sorry for the noise.