Bug 451725

Summary: Window maximized state and toolbar visibility lost after restart
Product: [Applications] konversation Reporter: Antonio Rojas <arojas>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.lohnau, argonel, heiko.becker, nate
Priority: NOR Keywords: regression
Version: 1.9.220380   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Antonio Rojas 2022-03-20 12:42:04 UTC
STEPS TO REPRODUCE
1. Open konversation
2. Maximize the window
3. Show the toolbar
4. Close konversation
5. Reopen konversation

OBSERVED RESULT
Window is displayed on the center of the screen, unmaximized, and without a toolbar

EXPECTED RESULT
Window state is kept across restarts.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Comment 1 Antonio Rojas 2022-03-20 13:06:29 UTC
Regressed in 7b767a0acbbf5804fafb7c52ac6c2f8db6fc0459
Comment 2 Alexander Lohnau 2022-03-20 19:19:37 UTC
Works for me (after I noticed that I re-logged in with Wayland instead of X11 :D).

Could you please share your graphics platform?
Comment 3 Heiko Becker 2022-03-20 19:24:21 UTC
I saw the same behaviour, but only once after updating from 21.12.3 to 22.08.30. A subsequent restart did remember the window geometry and layout. All on X11.
Comment 4 Antonio Rojas 2022-03-20 20:11:55 UTC
(In reply to Alexander Lohnau from comment #2)
> Works for me (after I noticed that I re-logged in with Wayland instead of
> X11 :D).
> 
> Could you please share your graphics platform?

I'm on Wayland
Comment 5 Alexander Lohnau 2022-03-20 20:23:35 UTC
>I'm on Wayland

The repositioning on the screen does not work on wayland by design, I will need to double-check regarding the window size.

>A subsequent restart did remember the window geometry and layout.

That might have then just been a transitional issue between the new/old config structure. Unfortunately the settings were not in separated from the other data and the keys are generated based on your screens/screen geometry. Meaning that we have the the risk of moving the application's config to a place where it does not belong when trying to migrate these files. Because of that we decided on not doing any migration for window size/positions.
Comment 6 Antonio Rojas 2022-03-20 20:55:22 UTC
(In reply to Alexander Lohnau from comment #5)
> >I'm on Wayland
> 
> The repositioning on the screen does not work on wayland by design, I will
> need to double-check regarding the window size.

ok, then s/position/maximized state/
Comment 7 Alexander Lohnau 2022-03-21 11:02:27 UTC
This works fine for me on wayland too, could you please attach your ~/.local/share/konversation/konversationstaterc file after maximizing the window and closing konversation?
Comment 8 Antonio Rojas 2022-03-21 11:33:16 UTC
(In reply to Alexander Lohnau from comment #7)
> This works fine for me on wayland too, could you please attach your
> ~/.local/share/konversation/konversationstaterc file after maximizing the
> window and closing konversation?

There's no such file
Comment 9 Antonio Rojas 2022-03-21 11:41:05 UTC
After removing ~/.config/konversationrc it started working fine and the ~/.local/share/konversation/konversationstaterc file is actually created. So it looks like an upgrade issue. Will post a minimal affected konversationrc.
Comment 10 Antonio Rojas 2022-03-21 21:28:39 UTC
Ok, so it's not an upgrade issue: it's the system tray icon. If it is enabled, konversationstaterc is never written on exit.
Comment 11 Alexander Lohnau 2022-04-04 18:30:05 UTC
Okay, I found a fix for this. Though it needs some more investigation
Comment 13 Alexander Lohnau 2022-04-17 04:38:56 UTC
Git commit 2e8ef91952e84201f67cb31536913c8a30ce3c95 by Alexander Lohnau.
Committed on 16/04/2022 at 18:37.
Pushed by alex into branch 'master'.

Fix saving of state config if one has autosave enabled

M  +3    -2    src/kmainwindow.cpp
M  +1    -0    src/kmainwindow.h
M  +5    -0    src/kmainwindow_p.h

https://invent.kde.org/frameworks/kxmlgui/commit/2e8ef91952e84201f67cb31536913c8a30ce3c95