Hahumm, how do I get #KDE to save window positions per monitor?
Thing is, I have the internal laptop screen, and an external one. Internal is 4k, external is 5k. Usually I only use external.

Now, I have an #HDMI switch, and whenever I switch to a different input, #KDE thinks the external monitor is gone missing. It turns on the internal one (annoying already), but as that is only 4k, it moves all windows around.
Now when I switch back, the external comes back, internal gets turned off.

But all window positions are gone. Instead of being on the middle, left, all over where I left them, they all crowd on the right side. And I have to press keys, on all virtual desktops, to get things back to useful.

Each and every time. (Except for the #Emacs window, that stays where it is, but it is the only one. Whyever.)

I probably could script myself something using wmctrl, I guess, but meh, I would expect a Window Manager to be able to deal with that on its own. But can't find the right setting.

@Ganneff should be somewhat fixed with Plasma 7.27 as they refactored the mutli-screen handling completly.

@bofh1337 So until then a wmctrl script OUGHT to help here.
Except - using #wmctrl to report on windows it shows me where they are, nicely. X, Y, Geometry.
Now, using wmctrl again to set the window property to that - it is wrong. 😡 🤬 X seems to be wrong by around 40 points, width around 15 to 20.

Useless. 😢

Boah, I do hate computer.

@Ganneff
Have you tried different activities? Activate a dummy with nothing important, switch hdmi input, re-activate original with all of your windows hopefully being placed correctly
@bofh1337

@holger
Interesting idea. Initial feeling: all Windows on 10 virtual desktops are moving. So "not visible" doesn't appear to be the thing.

But i sure give it a try this evening when I'm back in front of the laptop.

@bofh1337

@Ganneff
Please report back. I have some similar issues, though not severe between home and office setup. Just thought recently about that but I won't be in the office in a fortnight.
I still don't activities but it seems that they are much more independent than virtual desktops
@bofh1337
@holger @bofh1337 So, activity switch makes no difference. KDE happily moves windows around on all activities, even non-active ones.
@holger @bofh1337 Appears that the #kwin script "FlexGrid" from https://github.com/Hegemonia123/FlexGrid manages to correctly save and keep window positions here.
GitHub - Hegemonia123/FlexGrid: Kwin script - flexible window grid / tiling

Kwin script - flexible window grid / tiling. Contribute to Hegemonia123/FlexGrid development by creating an account on GitHub.

GitHub
@Ganneff
Thanks for the feedback and happy that you found a solution for yourself! In retrospect, it makes sense that tiling capabilities are the answer
@bofh1337