Skip to content

Don't overlap main windows when opening additional instances

Right now when restoring the position of main windows, we do it unconditionally. This means that if you have a KXMLGui-using app open and you open a new instance, the new instance gets position-restored and totally overlaps the existing window. This is not very nice.

With this commit, that issue is fixed.

Technical explanation: To accomplish this, now every time the window position data is read, we write out a value to the config file that indicates that we should not restore the position of the next window to be opened. This ensures that after opening one instance, the next one will never cover it up completely. Whenever any window is closed, we clear the config file value so that the next-opened window can once again restore the position of the last-opened one.

This is functionally equivalent to clearing the position config data on disk after reading it, but is simpler and does not result in that data being lost if the app crashes (in which case the main window wouldn't get closed nicely to write the data out again).

UX explanation: Apps where you regularly open multiple instances will no longer overlap one another, and the last-closed instance will be the one which gets its position saved. When you re-open that app after closing all instances, it will remember the last position of that window, but opening additional instances will let the window manager position them according to its own window placement settings.

BUG: 426725 FIXED-IN: 5.75

cc @kossebau @aacid

Edited by Nate Graham

Merge request reports