Bug 452564 - KDE apps remembering window position overlap existing instances if they have not been moved
Summary: KDE apps remembering window position overlap existing instances if they have ...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kxmlgui
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.92.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-13 00:27 UTC by Natalie Clarius
Modified: 2022-11-21 21:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Natalie Clarius 2022-04-13 00:27:46 UTC
SUMMARY
***
Overlap prevention on applications remembering their window positions does not take effect on windows that have not been moved.
***

STEPS TO REPRODUCE
1. Window Behavior settings: set Allow apps to remember their positions
2. Open a KDE application
3. Open a second instance of the same application

OBSERVED RESULT
The new instance completely overlaps the existing instance in the following cases:
- When a window is opened in a location that avoids overlap with an existing moved window, all subsequent windows overlap that second window.
- When a window that has been moved is moved back into its original position, all further windows overlap it.
- When all windows are closed, all new windows open in the remembered location (notably, if any window has been moved before it got closed, the location of the new windows will be the location of that moved window, even if it was not the last one to be active), overlapping.

The new instance does not overlap the existing instance in the following cases:
- When a window is moved, windows ones opened after that do not overlap the first window. 

EXPECTED RESULT
New instances never completely overlap existing instances.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Natalie Clarius 2022-04-28 00:52:36 UTC
Could this be related to https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/105?
Comment 2 Natalie Clarius 2022-04-28 01:03:42 UTC
I had a look at the code that introduced the overlap prevention (https://invent.kde.org/frameworks/kxmlgui/-/commit/ab43b986f3de20ff15b6438e56bfe29428bee3b1) and couldn't find anything wrong with it, but noticed that the entry `RestorePositionForNextInstance` in the application's configuration file doesn't change when according to the code it should; it does not get deleted when the window is closed. Could it be that the reason the overlap prevention didn't take effect in the cases described here is that the restore position flag just never was correctly saved, and that the above-mentioned MR would fix this? A thread in that MR mentions the position restoration feature, but I don't have a deep enough knowledge about how the configuration handling works to tell for sure.
Comment 3 Nate Graham 2022-05-02 18:14:05 UTC
Ah yes, that seems quite likely. Good catch. Feel free to submit a merge request to fix it!
Comment 4 Natalie Clarius 2022-05-03 12:26:00 UTC
Isn't this covered by the above mentioned MR? I can no longer reproduce this bug on the most recent stable Plasma version.
Comment 5 Natalie Clarius 2022-05-03 12:48:59 UTC
... on my own setup that is, but not on my test user account it seems. I'll look into it again and come back to this.
Comment 6 Natalie Clarius 2022-11-20 02:05:02 UTC
I can no longer reproduce it, I think it's been fixed.
Comment 7 Nate Graham 2022-11-21 21:16:05 UTC
Thanks for following up!