Many a time, I’ve wanted (for screenshot purposes, mostly) to revert a window to the size it is launched at, without closing and reopening the window - in order to not lose state. Is this whatsoever possible to implement (if the feature doesn’t yet exist)? I don’t see an option for a button which does so in the standard window decoration.
No, there isn’t.
If you’re okay with closing the window and reverting to its default size, you can move aside or delete its state or config file, or remove the lines in it that control what size the window opens at.
e.g. for Konsole, if you open the file ~/.local/state/konsolestaterc
and remove everything with “screen” in it under the [MainWindow]
header and then close and re-open the program, it’ll launch with the default window size.
So I suppose it’s a matter of GUI toolkits (as usual) then? That if it were theoretically implemented in the window manager, it would solely affect Qt or KDE Frameworks-based applications?
It would probably be done by the window manager, which is the thing that determines (and therefore knows) the size a window opened with.
I don’t see this being added to KWin though; it seems super duper duper niche. However it’s probably implementable with a custom KWin script; see KWin scripting tutorial | Developer.
Thanks, @ngraham. Knowing it’s possible is very useful.