Skip to content

Main: Use KConfig.WindowStateSaver for handle window geometry

Partially related to: https://bugs.kde.org/show_bug.cgi?id=491091

Hello again! 😀

This MR replaces the manual logic to save and restore window geometry with KConfig.WindowStateSaver. Other KDE applications have been doing this, and it may also help with the bug listed above once it is able to remember that the window was maximized. It currently seems to only store geometry (although window positioning seems to not work on restore, but that may be related to Wayland).

Right now with Kasts, it will forget its window geometry when closed while maximized. Also when it is re-opened, it will take up the full size of the screen - the equivalent to its maximized geometry (i.e. on a 1920x1080 display it will open at or around 1920x1080, assuming no panels). And as well as this, it will forget whether it was maximized or not, so it always re-opens windowed even if it was previously closed while maximized.

This is very similar to a bug I recently encountered with Discover, although Discover remembers its maximized state because it uses custom logic to do so. Such a thing could possibly be implemented here, although Discover uses KConfigStore (consistent with how it stores geometry) and Kasts could probably use QML in some fashion to save and restore this.

I am not sure if and how this applies to mobile, let me know if there are any concerns here!


This MR is opened as a draft because I am waiting to see how my MR for Discover is received and to see if any further work is needed. Still feedback is appreciated, I am happy to accept feedback and discuss things!

Thanks!

Edited by Eamonn Rea

Merge request reports