Bug 461204

Summary: Window not resized to fit within screen when opened with a remembered former size that's bigger than the current screen size
Product: [Plasma] kwin Reporter: fw.smit01
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kishore96, miranda, nate
Priority: NOR Keywords: usability
Version First Reported In: 5.25.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description fw.smit01 2022-10-30 13:12:07 UTC
SUMMARY
Sometimes, when I open an app, the window is larger than my entire screen. It also centers on the screen, making it impossible to resize it without knowing the shortcut to move a window (for example Meta+click). I think it shouldn't be possible for a window to be larger than the screen at all. Or at least on startup it is very undesirable.

STEPS TO REPRODUCE
1. Open an application, for example Discover.
2. Move it to the bottom left of your screen and resize it as much as you can.
3. Close the application
4. Open the application

This is a way to reproduce it, which probably doesn't happen very often.  In practice it happens for me after using a bigger monitor and switching back to a smaller one. Maybe I resized some windows to about the size of the screen, or some other kwin bug happened, resizing the window to the screen size.
This is to say, it happens pretty often.

OBSERVED RESULT
The application is larger than your screen, and is centered. Making it impossible to get to the edges without knowing a keyboard shortcut.

EXPECTED RESULT
The window is resized to the size of your screen.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 36
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 5.19.16-200.fc36.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz
Memory: 15,4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
Manufacturer: HP
Product Name: HP ZBook Studio G5

ADDITIONAL INFORMATION
My laptop's screen is 1920x1080 (this is where the bug happens)
My other monitor is 1440p (this may be the cause of the windows being larger)
Comment 1 Bug Janitor Service 2022-10-30 13:33:50 UTC
Thank you for the bug report!

Please note that Plasma 5.25.5 is not supported for much longer by KDE; supported versions are 5.24, and 5.26 or newer.

If at all possible please upgrade to a supported version and verify that the bug is still happening there.

If you're unsure how to do this, contact your distributor about it.
Comment 2 Nate Graham 2022-11-01 13:42:30 UTC
Discover's minimum window size is much smaller than either of your screens, so KWin should be able to resize it to make sure it fits. If it's not doing that properly, that does seem like a bug.
Comment 3 Nate Graham 2022-11-04 16:06:42 UTC
Can reproduce with Discover if I don't maximize it. Steps to reproduce:

1. Have two screens, one bigger and one smaller
2. Open Discover and move it to the bigger screen
3. Make it as big as the whole screen but *don't* maximize it
4. Quit Discover
5. Disconnect the big screen
6. Open Discover

Result: Discover opens at its old size rather than being resized to fit within the smaller screen.