Summary: | Kwin moving windows and resizing them very poorly to unusable states on multi-monitor setups during unplug events | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Michael Butash <michael> |
Component: | multi-screen | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | g.guerin, nate |
Priority: | NOR | ||
Version: | 5.27.2 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Michael Butash
2023-04-05 21:52:10 UTC
Some additional feedback, not all windows will get resized, or not all the time. Mostly commonly affected resizing tends affect firefox, libreoffice, konsole, ksettings, pluma, others, but NOT keepassxc, okular, dolphin, telegram/signal electron apps, again others. It's enough varieties it's not prone to any one UI like QT vs. GTK or like. As well the resizing after clearing settings only started after 2 weeks, where originally it was perfect restoring my windows to the right places, but slowly gets worse in moving/resizing over time. Each time now seems to bring stranger and stranger placements where windows are moved or resized to. I also have an issue along those lines. When unpluging my external screen from my laptop, many windows (e.g. firefox and gnucash) are not (or not appropriately) resized when moved to the laptop screen. Specifically they are too heigh with the title bar being out of the screen, meaning I cannot move/minmize/maximize/close them, I have to use the shortcut Ctrl + F5 to move them and then resize manually. External screen is a 34" 3440x1440 whereas laptop screen is 14" 1920x1080 (no scaling applied to either). Operating System: KDE neon 5.27 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.105.0 Qt Version: 5.15.9 Kernel Version: 6.1.22-060122-generic (64-bit) Graphics Platform: Wayland Processors: 8 × Intel® Core™ i5-8350U CPU @ 1.70GHz Memory: 15.3 GiB of RAM Graphics Processor: Mesa Intel® UHD Graphics 620 I have no idea how Kwin handles this currently (and so I don't want to tell dev how to do things) but just in case it's useful, it sounds like a systematic approach when it comes to window size and placement could be: To define window size on any given screen: ==================================== width ratio = (window width in px / screen width in px) height ratio = (window height in px/ screen height in px) >> those width/height ratios can then be applied to different size screens' height / width in plug / unplug events which would conserve the same relative window size across any screen (independently of absolute screen size or aspect ration). To define windows placement: ========================= horizontal ratio: distance between screen left edge and window horizontal centre / distance between screen left edge and screen horizontal centre (i.e. half screen width) vertical ratio: distance between screen top edge and window vertical centre / distance between screen top edge and screen vertical centre (i.e. half screen height) >> those ratio can then be applied to the window (horizontal / vertical) centre in plug / unplug events so the relative placement is conserved across any screens (independently of absolute screen size or aspect ration). Also wonder if this is related to the bug 452118, at least they both relate to window resizing on plug / unplug. Agree with Gauthier, there are some deeply rooted problems here common to various scenarios folks seem to see in more exotic display setups (sadly anything +1 or more). Checking back in on this, I'd been working with the dev of restoreToScreen that did make some changes, and seems to be much better behaved now, but per Zamundaaa's posting to restoreToScreen's github issues, supposedly kwin does this now too, so which should we really be relying on and/or fixing? If kde should be managing screens without the restoreToScreen kwin script, it certainly doesn't do so properly, so should that be fixed, or simply not used or at least trusted to work? Since restoreToScreen made changes for current kde, my windows mostly track the screens properly again except a few windows, notably virtualbox and gkrellm still that refuse to move, or if so badly. Occasionally however the problems seem to come when my edid adapters or even the display sorta go braindead during a display geometry change event, and kde/kscreen *learns* a new display array profile until I physically reset power on them (reliable hardware is hard to find). When having issues prior, I had some 40-ish display profiles saved by kscreen after 6 months of a new laptop that upon clearing out, life got much better, but again that grows now. When I get severely bad window resizing, it's usually because my displays landed on something new like missing a display suddenly, or displays otherwise change. All displays are 4k however, and in theory nothing should have to change such as a display suddenly going to 640x480 and back, so not sure why it so grossly resizes my windows to like 5px wide, but still normally tall. On a 4k display, when they all move to my 15" display, I hate my life to find and resize back. It should simply never, like ever, do this in its worst days, or have some sympathy to undo it's screw-up to put things back as they were. It would be nice to have a way to manage these auto-learned display array setups to either accept or summarily reject, but either way not retain indefinitely to confuse kde over time, particularly across major versions such as 5.27 with multi-monitor changes. Otherwise, it would be nice to properly scope how kde/kscreen *should* handle window placements with or without external script help. *** This bug has been marked as a duplicate of bug 452118 *** |