Bug 453668 - Windows moved and window sizes are squashed when unplugging/replugging screen with differing resolution from the primary one
Summary: Windows moved and window sizes are squashed when unplugging/replugging screen...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.24.4
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-11 16:46 UTC by Andreas Aardal Hanssen
Modified: 2023-04-26 03:46 UTC (History)
2 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 Andreas Aardal Hanssen 2022-05-11 16:46:06 UTC
When turning screens on and off in a multiscreen setup, it's important that windows that don't have to move, don't move, and windows whose size doesn't need to change, doesn't change. Currently what happens is consistently wrong but entirely random.

I'm on a dual screen setup, screens left and right. Left primary screen is a 21:9 3440x1440, right screen is 16:9 3840x2160.

When the right screen is turned off and then back on again, random things happen. The most common are:

a) that all windows move to the right hand screen, i.e. the secondary, and that the left hand screen is black and flickery, looking like the wallpaper vanished and was replaced with <void>.

b) the all windows move to the left hand screen, but their heights are all reduced to around 30%.

STEPS TO REPRODUCE
1. Dual screen setup, my particular setup is 21:9 3440x1440 primary and 16:9 3840x2160 not primary
2. Turn the right screen off.
3. Turn the right screen on.

OBSERVED RESULT

Sometimes: After step 2, all windows on the primary screen are reduced in height to around 30% and they are all moved to the bottom of the screen. I use a virtual desktop setup, and all windows on all virtual desktops are like this. The wallpaper on the primary screen is gone.

Other times: After step 3, all windows are moved to the secondary screen and the primary screen is left empty.

EXPECTED RESULT

I expect everything on screen 1 to stay unchanged when screen 2 is turned off. I expect windows on screen 2 to move to screen 1.

If I turn screen 2 back on, I am fine with nothing happening to windows on screen 1. Ideally, the windows that were pushed into screen 1 automatically go back.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Comment 1 Nate Graham 2022-05-12 15:33:17 UTC
Is this on X11 or Wayland? Does it affect all windows, or only windows of some KDE apps?
Comment 2 Andreas Aardal Hanssen 2022-05-13 18:32:26 UTC
(In reply to Nate Graham from comment #1)
> Is this on X11 or Wayland? Does it affect all windows, or only windows of
> some KDE apps?

X11 and applies to all apps that don't have explicit size saved. My terminal windows remains unaffected. Very easy to reproduce... firefox fex, or Qt Creator, resize manually to approx 90% of size of screen both dimensions, window on the primary screen. Turn off the secondary screen, and the window immediately resizes to approx 30% height (width is unchanged). I think it has to do with the vertical resolution being different on the two screens maybe...
Comment 3 Nate Graham 2022-05-16 15:39:20 UTC
Seems likely, yeah.

Does it happen in the Wayland session, or only in the X11 session?
Comment 4 Bug Janitor Service 2022-05-31 04:35:46 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 5 Bug Janitor Service 2022-06-15 04:35:22 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!
Comment 6 Andreas Aardal Hanssen 2022-06-15 04:50:29 UTC
I’ve tried to enable wayland session but it’s completely broken, so I can’t say. This bug is very valid and trivial to reproduce so, no information needed about that.
Comment 7 Kliment Yanev 2023-02-25 17:36:58 UTC
I am observing the same issue, also on Kubuntu, using X11 on an amd embedded gpu.

My setup is 1920x1200 primary and 3840x2160 secondary. When the secondary display is removed, I get the window resizing for non-maximized, non-tiled windows, they get squashed to a smaller vertical height and moved, but not changed in the horizontal dimension.
Comment 8 Nate Graham 2023-02-27 16:33:15 UTC
Would be interesting to know if this reproduced on Plasma 5.26 or later. those versions included more robust code for multimonitor window positioning.
Comment 9 Bug Janitor Service 2023-03-14 03:45:39 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 10 Kliment Yanev 2023-03-19 10:29:28 UTC
(In reply to Nate Graham from comment #8)
> Would be interesting to know if this reproduced on Plasma 5.26 or later.
> those versions included more robust code for multimonitor window positioning.

Is there a known distribution that packages 5.26 or later? I can try this if there's a liveusb image I can run it from.
Comment 11 Nate Graham 2023-03-27 18:40:29 UTC
Many do. Arch, Manjaro, openSUSE Tumbleweed, Fedora KDE, and Debian Sid spring to mind.
Comment 12 Kliment Yanev 2023-03-27 18:57:17 UTC
(In reply to Nate Graham from comment #11)
> Many do. Arch, Manjaro, openSUSE Tumbleweed, Fedora KDE, and Debian Sid
> spring to mind.

Alright, I'll grab one of those and give it a try tomorrow.
Comment 13 Bug Janitor Service 2023-04-11 03:45:50 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 14 Bug Janitor Service 2023-04-26 03:46:15 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!