Bug 476037 - external monitor disabled temporarily upon DPMS on, resulting in misposition of vertically maximized windows
Summary: external monitor disabled temporarily upon DPMS on, resulting in misposition ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.27.8
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, wayland
Depends on:
Blocks:
 
Reported: 2023-10-24 07:39 UTC by Jiri Slaby
Modified: 2024-05-03 14:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Slaby 2023-10-24 07:39:04 UTC
SUMMARY
If both monitors:
> Output: 1 eDP-1 enabled connected priority 1 Panel Modes: 0:1920x1200@60*! 1:1920x1200@50 2:1920x1200@48 3:1920x1080@60 4:1600x1200@60 5:1680x1050@60 6:1280x1024@60 7:1440x900@60 8:1280x800@60 9:1280x720@60 10:1024x768@60 11:800x600@60 12:640x480@60 13:1600x1200@60 14:1280x1024@60 15:1024x768@60 16:1920x1200@60 17:1280x800@60 18:1920x1080@60 19:1600x900@60 20:1368x768@60 21:1280x720@60 Geometry: 489,1440 1536x960 Scale: 1.25 Rotation: 1 Overscan: 0 Vrr: Automatic RgbRange: unknown
> Output: 2 DP-7 enabled connected priority 2 DisplayPort Modes: 0:3840x2160@60*! 1:3840x2160@60 2:3840x2160@60 3:3840x2160@50 4:3840x2160@30 5:3840x2160@30 6:3840x2160@30 7:2560x1440@60 8:1920x1080@60 9:1920x1080@60 10:1920x1080@60 11:1920x1080@50 12:1920x1080@50 13:1680x1050@60 14:1600x900@60 15:1280x1024@75 16:1280x1024@60 17:1440x900@60 18:1280x800@60 19:1152x864@75 20:1280x720@60 21:1280x720@60 22:1280x720@60 23:1280x720@50 24:1024x768@75 25:1024x768@70 26:1024x768@60 27:832x624@75 28:800x600@75 29:800x600@72 30:800x600@60 31:800x600@56 32:720x576@50 33:720x480@60 34:720x480@60 35:640x480@75 36:640x480@73 37:640x480@67 38:640x480@60 39:640x480@60 40:720x400@70 41:1600x1200@60 42:1280x1024@60 43:1024x768@60 44:2560x1600@60 45:1920x1200@60 46:1280x800@60 47:3840x2160@60 48:3200x1800@60 49:2880x1620@60 50:2560x1440@60 51:1920x1080@60 52:1600x900@60 53:1368x768@60 54:1280x720@60 Geometry: 0,0 2560x1440 Scale: 1.5 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown

go to DPMS off due to inactivity, waking DP-7 up takes so long, that windows are moved to eDP-1 temporarily for a second or two. Then again, all windows are restored to DP-7. 

STEPS TO REPRODUCE
1. be inactive
2. monitors go to sleep
3. move mouse
4. internal monitor on eDP-1 resumes quickly
5. windows from original DP-7 are moved to eDP-1
6. monitor on DP-7 resumes only now
7. windows are restored to DP-7

OBSERVED RESULT
windows are moved back and forth

EXPECTED RESULT
it is wait for the monitor to appear. Maybe to low timeout is set?

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20231022
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.5.9-rc1-1.ga138c10-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 6850U with Radeon Graphics
Memory: 29.9 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 21CRS0K83K
System Version: ThinkPad T14s Gen 3
Comment 1 Nate Graham 2023-10-24 18:13:54 UTC
Xaver, is this the thing that's already fixed in Plasma 6?
Comment 2 Zamundaaa 2023-10-27 19:40:56 UTC
No, that was about not unnecessarily turning displays back on. If a display temporarily pretends it's disconnected after waking up, that's not a problem we can fix. All we can do is to restore the state when the display gets recognized again, and it sounds like that's working correctly.
Comment 3 Jiri Slaby 2023-11-01 07:51:17 UTC
(In reply to Zamundaaa from comment #2)
> No, that was about not unnecessarily turning displays back on. If a display
> temporarily pretends it's disconnected after waking up, that's not a problem
> we can fix.

Reported against amdgpu then:
https://gitlab.freedesktop.org/drm/amd/-/issues/2958

> All we can do is to restore the state when the display gets
> recognized again, and it sounds like that's working correctly.

Mostly ;). Vertically maximized windows are misplaced. Should I create a separate bug or can we continue here?

That is:
1) I have a window which is on (0,-1) (left bottom) on the external monitor.
2) I vertically maximize that
3) dpms off
4) dpms on
5) the window is moved to internal monitor at (0,-1)
6) external monitor resumes
7) the window is correctly moved to external monitor, but wrongly to (1536,-1)

Note the x position of the window corresponds to the bottom display.
Comment 4 Bug Janitor Service 2024-04-27 16:01:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5666
Comment 5 Zamundaaa 2024-05-03 13:53:34 UTC
Git commit fb28d75ad8efd8b58ef572e2163b8082fc9095c9 by Xaver Hugl.
Committed on 03/05/2024 at 13:45.
Pushed by zamundaaa into branch 'master'.

placementtracker: fix vertically maximized windows being misplaced

...and extend the autotest to cover that situation.

M  +23   -13   autotests/integration/outputchanges_test.cpp
M  +1    -11   src/placementtracker.cpp

https://invent.kde.org/plasma/kwin/-/commit/fb28d75ad8efd8b58ef572e2163b8082fc9095c9
Comment 6 Zamundaaa 2024-05-03 13:53:42 UTC
Git commit df9f8f8346b5b7645578e37365dabb1a7b02ca5a by Xaver Hugl.
Committed on 03/05/2024 at 13:45.
Pushed by zamundaaa into branch 'master'.

fix vertically maximized windows sometimes being moved out of the screen

...and add a test for it

M  +86   -0    autotests/integration/outputchanges_test.cpp
M  +1    -1    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/df9f8f8346b5b7645578e37365dabb1a7b02ca5a
Comment 7 Zamundaaa 2024-05-03 14:12:24 UTC
Git commit 5049dd233750001ccdad875ac668b7c6c89570fe by Xaver Hugl.
Committed on 03/05/2024 at 13:55.
Pushed by zamundaaa into branch 'Plasma/6.0'.

placementtracker: fix vertically maximized windows being misplaced

...and extend the autotest to cover that situation.

M  +23   -13   autotests/integration/outputchanges_test.cpp
M  +1    -11   src/placementtracker.cpp

https://invent.kde.org/plasma/kwin/-/commit/5049dd233750001ccdad875ac668b7c6c89570fe
Comment 8 Zamundaaa 2024-05-03 14:12:32 UTC
Git commit a32456618ada23cbb860f75a0a41b4dbe8187f4c by Xaver Hugl.
Committed on 03/05/2024 at 13:55.
Pushed by zamundaaa into branch 'Plasma/6.0'.

fix vertically maximized windows sometimes being moved out of the screen

...and add a test for it

M  +86   -0    autotests/integration/outputchanges_test.cpp
M  +1    -1    src/window.cpp

https://invent.kde.org/plasma/kwin/-/commit/a32456618ada23cbb860f75a0a41b4dbe8187f4c