Saving window placements on wayland

There are valid reasons for the Wayland approach. What you may be forgetting is that on X11, only some apps remember their own positions. Many don’t do it at all; it’s a per-window opt-in thing. Until I implemented this feature for KXMLGui, almost no KDE apps did. And even now, all non-KDE apps that implement this feature have to do it themselves, because no cross-toolkit library exists for window positioning. Generally this is fine as long as you have a single screen, but the moment you have two or more, it breaks down because the level of complexity increases dramatically and every app that implements the feature handles that complexity in a different way.

For example some store an absolute position relative to the total geometry, which breaks if you re-arrange your screens. Some try to remember which screen they were on by storing the screen used and the position on that screen, but this can break because there are many ways to identify screens and almost all of them are volatile. Some abuse the feature to always position themselves on the primary screen whether you want this or not. And so on. I learned how challenging of a task it is to get this right while writing and later tweaking the aforementioned KXMLGui feature in response to a great deal of user feedback.

The net result is that on X11 almost every window positions itself (or not) in subtly different ways that in practice can feel very random, even if you have a simple single-screen setup–and it’s much worse if you have a multi-screen setup. The Wayland approach allows for all of this to go away because the compositor applies one set of rules for how to handle positioning that all windows have to obey, which makes the positioning consistent and predictable. It also allows you to disable the behavior if you’d prefer for the compositor to always position all windows.

Of course that’s in principle what will be possible once the feature is implemented in KWin. I do understand that it’s frustrating to read about theoretical benefits when there’s no implementation yet!

6 Likes