Bug 502293

Summary: Windows are not resized back to original size
Product: [Plasma] kwin Reporter: Riccardo Robecchi <sephiroth_pk>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: nate, xaver.hugl
Priority: NOR    
Version First Reported In: 6.3.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=459136
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Riccardo Robecchi 2025-04-01 16:45:39 UTC
SUMMARY
When windows are resized by the system, e.g. when a screen is disconnected, they do not go back to their original size but they keep their new smaller size.
This is the same as bug 459136 but, as instructed in bug 449924, I am opening a different bug because this behaviour is not specific to virtual keyboards (although I would say it is the exact same bug with the exact same cause, it's just that it is not triggered only by virtual keyboards but by any event which resizes windows...).

STEPS TO REPRODUCE
1. Disconnect a screen

OBSERVED RESULT
Windows are resized.

EXPECTED RESULT
Windows are not resized.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Comment 1 Zamundaaa 2025-04-01 17:06:31 UTC
What do you mean with "original size"? Can you go over the exact sequence of events that causes the problem, and what exactly you would expect to happen instead?

> although I would say it is the exact same bug with the exact same cause
No, it's completely separate logic.
Comment 2 Riccardo Robecchi 2025-04-01 21:20:47 UTC
Here's my configuration: I have the laptop's monitor which is replicated to another monitor (with the same resolution), then I have a third monitor which is on top of the second. Say I have a Konsole window open, size 104 x 28. If I unplug a screen, the Konsole window will be squashed to a seventh of that size - so it will be 104 x 4 - and it will be moved to the top of the screen. Every other non-maximised window will be squashed to the same size. LibreOffice, as an example, is resized so that only the toolbar is visible (with the Ribbon-style interface enabled). This happens every time I unplug the laptop from the docking station.

What I mean with "original size" is that the Konsole window shouldn't be squashed to 104 x 4, it should retain its original 104 x 28 size. If the screen configuration changes for a moment to something smaller, the windows should go back to their original size they had when there was enough space.

The reason I am saying it's probably the same thing is because this used to work as expected, i.e. a *momentary* change in screen geometry (be it due to a screen disconnection or a virtual keyboard) did not *permanently* resize the windows, and then something changed with Plasma 5.24 (I reported bug 449924). And this change affects not only virtual keyboards, but all cases in which the screen geometry changes and windows are resized due to this. It might be something different under the hood, but the cause (screen geometry change) and result (windows not going back to the original size) appear to be the exact same.
Comment 3 Zamundaaa 2025-05-26 15:15:00 UTC
Is that happening on X11 or Wayland? IIRC on X11 there were some edge cases where hotplugging could cause weird resizes, as the panels moved around in a weird way (or didn't move when they should)
Comment 4 Riccardo Robecchi 2025-05-26 15:26:00 UTC
(In reply to Zamundaaa from comment #3)
> Is that happening on X11 or Wayland? IIRC on X11 there were some edge cases
> where hotplugging could cause weird resizes, as the panels moved around in a
> weird way (or didn't move when they should)

X11. IIRC this happened on Wayland as well, but I haven't tried in a while.