winft / disman

Qt/C++ display management library
GNU Lesser General Public License v2.1
3 stars 1 forks source link

Configured display resolution not preserved after logout and disconnect #36

Closed romangg closed 8 months ago

romangg commented 4 years ago

In GitLab by @lessoffensive on Oct 20, 2020, 18:07

Setup

System

Issue

After logout and upon logging back in, and also after disconnecting and reconnecting, the 3840x2160 monitor is set to 3840x2160, rather than the 1920x1080 that I had set it to, and it overlaps the second monitor entirely. It appears that the resolution is being set to the native resolution rather than the configured resolution, with the position remaining the same, hence the screen overlap.

Expected Result

All configured monitors remain set to the configured resolution and position for logout/login and disconnect/reconnect events

I've attached a screenshot to illustrate this issue, along with how it appears in the display settings--there's no graphics corruption, I've just blurred and blacked out some areas for privacy. The lower right corner is transparent due to the total desktop resolution not being square.

Thanks!

Desktop_1_2020-10-19-23_34_39

romangg commented 4 years ago

Did I get that right to reproduce:

Result: resolution for the 4K monitor is not set to 1080p but to its native resolution.

Please attach xrandr output from before and after logout+disconnect.

romangg commented 4 years ago

In GitLab by @mjasnik on Oct 21, 2020, 08:01

I have exactly the same configuration as OP, I have a laptop with 2 external displays connected via docking station (if that matters), but they are identified as normal DP displays.

xrandr | grep " connected"
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 350mm x 190mm
DP1-1 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 520mm x 320mm
DP1-2 connected 1080x1920+3840+0 left (normal left inverted right x axis y axis) 510mm x 290mm

I have not checked logout (will do when I can and post here the results), but after disconnect there are things which are happening incorrectly:

I have checked .local/share/kscreen/ files and the only change after reconnection seems to be "enabled: false". I edited config file before reconnecting monitor and set enabled to true, after reconnection it gets rewritten to false again.

P.S. I'll create a new ticket, if that's needed.

romangg commented 4 years ago

.local/share/kscreen/

Note that Disman saves its data to .local/share/disman/. If files in the kscreen subdirectory change you have still KScreen installed with the KScreen KDE daemon module. You should uninstall the "kscreen" package (not the "libkscreen" package) to guarantee no interference.

romangg commented 4 years ago

In GitLab by @mjasnik on Oct 21, 2020, 10:54

pacman -Q | grep -i kscreen
kscreenlocker 5.20.0-1
libkscreen 5.20.0-1

It was not installed, but after log out / log in I don't have this issue anymore. Now it's exactly as OP described (will post xrandr before and after disconnect in separate reply).

romangg commented 4 years ago

In GitLab by @mjasnik on Oct 21, 2020, 11:01

xrandr output when everything is set up as needed: kwinft.disman.issue.36.setup.txt

xrandr output after disconnect of both external displays: kwinft.disman.issue.36.after.disconnect.txt

xrandr output after reconnect of both external displays: kwinft.disman.issue.36.after.recconect.txt

romangg commented 4 years ago

In GitLab by @mjasnik on Oct 21, 2020, 11:20

I have verified that when I configure displays as I need, config and output directories (in .local/share/disman/control) have correct config files with auto-resolution false and configured width and height.

After disconnect or reconnect external displays they are rewritten. auto-resolution still stays false, just width and height are rewritten as native resolution values.

romangg commented 4 years ago

In GitLab by @lessoffensive on Oct 21, 2020, 14:49

Thanks for looking into this Roman. To clarify, the same behavior happens in two scenarios for me: either logging out and then back in, or disconnecting and reconnecting the monitor. So the steps to reproduce are as follows:

Login/logout

Before logout

Screen 0: minimum 320 x 200, current 5760 x 1080, maximum 16384 x 16384
eDP connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.16*+  40.11  
   1680x1050     60.16  
   1280x1024     60.16  
   1440x900      60.16  
   1280x800      60.16  
   1280x720      60.16  
   1024x768      60.16  
   800x600       60.16  
   640x480       60.16  
HDMI-A-0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00 +  74.97*   50.00    59.94  
   1680x1050     59.88  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      59.90  
   1280x800      59.91  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
   720x400       70.08  
DisplayPort-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160     60.00 +  50.00    59.94    30.00    30.00    25.00    24.00    29.97    23.98  
   2560x1440     59.95  
   1920x1200     60.00  
   1920x1080     60.00*   50.00    59.94    30.00    24.00    29.97    23.98  
   1600x1200     60.00  
   1680x1050     60.00  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      60.00  
   1280x800      59.91  
   1280x720      60.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94

After logging back in

Screen 0: minimum 320 x 200, current 5760 x 2160, maximum 16384 x 16384
eDP connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.16*+  40.11  
   1680x1050     60.16  
   1280x1024     60.16  
   1440x900      60.16  
   1280x800      60.16  
   1280x720      60.16  
   1024x768      60.16  
   800x600       60.16  
   640x480       60.16  
HDMI-A-0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  74.97    50.00    59.94  
   1680x1050     59.88  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      59.90  
   1280x800      59.91  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
   720x400       70.08  
DisplayPort-0 connected 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160     60.00*+  50.00    59.94    30.00    30.00    25.00    24.00    29.97    23.98  
   2560x1440     59.95  
   1920x1200     60.00  
   1920x1080     60.00    50.00    59.94    30.00    24.00    29.97    23.98  
   1600x1200     60.00  
   1680x1050     60.00  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      60.00  
   1280x800      59.91  
   1280x720      60.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94

Disconnect/Reconnect

Before disconnecting

Screen 0: minimum 320 x 200, current 5760 x 1080, maximum 16384 x 16384
eDP connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.16*+  40.11  
   1680x1050     60.16  
   1280x1024     60.16  
   1440x900      60.16  
   1280x800      60.16  
   1280x720      60.16  
   1024x768      60.16  
   800x600       60.16  
   640x480       60.16  
HDMI-A-0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00 +  74.97*   50.00    59.94  
   1680x1050     59.88  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      59.90  
   1280x800      59.91  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
   720x400       70.08  
DisplayPort-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160     60.00 +  50.00    59.94    30.00    30.00    25.00    24.00    29.97    23.98  
   2560x1440     59.95  
   1920x1200     60.00  
   1920x1080     60.00*   50.00    59.94    30.00    24.00    29.97    23.98  
   1600x1200     60.00  
   1680x1050     60.00  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      60.00  
   1280x800      59.91  
   1280x720      60.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94

After reconnecting the monitor

Screen 0: minimum 320 x 200, current 5760 x 2160, maximum 16384 x 16384
eDP connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.16*+  40.11  
   1680x1050     60.16  
   1280x1024     60.16  
   1440x900      60.16  
   1280x800      60.16  
   1280x720      60.16  
   1024x768      60.16  
   800x600       60.16  
   640x480       60.16  
HDMI-A-0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  74.97    50.00    59.94  
   1680x1050     59.88  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      59.90  
   1280x800      59.91  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
   720x400       70.08  
DisplayPort-0 connected 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160     60.00*+  50.00    59.94    30.00    30.00    25.00    24.00    29.97    23.98  
   2560x1440     59.95  
   1920x1200     60.00  
   1920x1080     60.00    50.00    59.94    30.00    24.00    29.97    23.98  
   1600x1200     60.00  
   1680x1050     60.00  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      60.00  
   1280x800      59.91  
   1280x720      60.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       60.00    59.94
romangg commented 4 years ago

In GitLab by @alessio11 on Nov 11, 2020, 08:17

Updated Manjaro, no kscreen installed, I get the same on my laptop (no external display) after the latest KDE update: after logging out, Plasma/X11 always starts with the native resolution (4K).

I removed share/disman and share/kdisplay, but no differences.

romangg commented 4 years ago

A fix has not yet been landed as I'm currently working on other things in KWinFT but maybe somebody else want to take a look?

Is this a very annoying bug from user pov or can it be worked around for now?

romangg commented 3 years ago

In GitLab by @alessio11 on Nov 12, 2020, 13:37

Surely annoying but nothing tragic I'd say, it just takes a few clicks to select a new resolution after a reboot or logout, not such a big deal. :-)

romangg commented 3 years ago

In GitLab by @JensDA on Nov 12, 2020, 14:36

It's not just at reboot.

Every time I switch on my second screen and every time I switch on my AV-Receiver I have to change my primary screen's frame rate again.

romangg commented 3 years ago

Thanks for the feedback guys. I'll try to take a look over at it over the weekend next week. I hope I can reproduce the reset of properties.

If I have more questions for that I'll post back here.

romangg commented 3 years ago

I was able to reproduce the issue just by restarting the backend service with a different resolution than default.

I've created a fix in !23. Can you compile that branch and test if it fixes the issue for you too?

romangg commented 3 years ago

In GitLab by @lessoffensive on Nov 24, 2020, 14:43

Just got that branch compiled and it looks like that fixes the issue. Thanks Roman!

romangg commented 3 years ago

Hi Scott, that's great to hear. Thanks for testing. I'll spin a bug fix release once there is also a patch for #35.

romangg commented 3 years ago

In GitLab by @mjasnik on Nov 26, 2020, 09:09

I have tested this too, except that I build standard Plasma 5.20 branch + those 2 patches. It solved issue for me too, thanks!

romangg commented 3 years ago

mentioned in commit a52f04ebf04e3a8180093b942ee9bb4f34eb3c06

romangg commented 3 years ago

In GitLab by @alessio11 on Dec 9, 2020, 15:03

I can't use the fix on my main computer until a release is out, but I managed to test it on a secondary rig and it works perfectly. Thanks!

romangg commented 3 years ago

Thanks for testing! I just created a bug fix release: disman@0.520.1 so hopefully soon available on your distro of choice.