Bug 463139 - Plasma session restore no longer opens files in kwrite
Summary: Plasma session restore no longer opens files in kwrite
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: 22.12.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 463720 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-12-17 00:25 UTC by tguen
Modified: 2023-01-02 17:56 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tguen 2022-12-17 00:25:20 UTC
SUMMARY

Not sure if this is actually specific to kwrite, that's generally all I use.

Plasma is configured to restore my previous session on start, so all of my files that were open in kwrite before shutdown should be reopened. Some time in the last month or so, kwrite got a new splash screen that shows a list of recent documents, and it broke session restore. Instead of reopening my files, it reopens the same number of kwrite windows, but only showing the splash screen. It also always shows the toolbars which I've hidden.


STEPS TO REPRODUCE
1. go to System Settings > Startup and Shutdown > Desktop Session, set 'when logging in' to 'restore last session'
2. open any file in kwrite
3. go to the settings menu and hide the toolbars
4. reboot

OBSERVED RESULT
After rebooting, kwrite displays toolbars and list of recent documents

EXPECTED RESULT
After rebooting, kwrite displays previously opened file and toolbars remain hidden

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Comment 1 local10 2022-12-18 08:48:59 UTC
Am having the same (or similar) issue.

After a recent upgrade (kwrite:amd64 4:22.04.3-1 -> 4:22.12.0-2) Kwrite no longer remembers what files it had open before logging out of KDE or rebooting the PC. If I had, for example, two files open in Kwrite in two separate windows before logging out of KDE, when logged back into KDE, KDE would open two empty Kwrite windows instead of properly showing the files that used to be in those windows.

Other apps (for example, Okular) properly open files they had open before logging out of KDE after logging back into KDE.

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.26.4  KDE Frameworks Version: 5.100.0  Qt Version: 5.15.6
Kernel Version: 6.0.0-6-amd64 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1026307
Comment 2 Ingo Klöcker 2022-12-18 10:38:44 UTC
This looks very much like a regression of the new tab support in KWrite. On the first login after the upgrade to 22.12, I had hoped that this is just a one-off problem because each instance of KWrite now has to remember a list of open documents instead of just one document. But apparently, this is just broken and not just an upgrade issue.
Comment 3 Christoph Cullmann 2022-12-18 12:46:15 UTC
Does the session restore work for Kate?
Comment 4 Ingo Klöcker 2022-12-18 15:01:01 UTC
Yes, for Kate it works as good as before the upgrade regardless of whether I use a named session or just a bunch of files.
Comment 5 Christoph Cullmann 2022-12-18 15:03:06 UTC
Hmm, ok, then I must have messed that up with some of the few divergences for KWrite mode.

I skipped some restore steps but thought that should only affect the not used mdi stuff...
Comment 6 Christoph Cullmann 2022-12-18 15:25:21 UTC
Could you try if this commit is the reason for that!

https://invent.kde.org/utilities/kate/-/commit/5dac26e2b7747aab9a97a4eb516a83990d2122ed
Comment 7 Christoph Cullmann 2022-12-18 17:16:21 UTC
Please try

https://invent.kde.org/utilities/kate/-/merge_requests/1045
Comment 8 Christoph Cullmann 2022-12-27 19:52:12 UTC
If somebody would try that, I could fix and backport it, else it stays broken.
Comment 9 local10 2022-12-28 16:21:10 UTC
(In reply to Christoph Cullmann from comment #8)
> If somebody would try that, I could fix and backport it, else it stays
> broken.

I'm interested in the fix so I'd try it if you provide the affected lib/executable file to try with the instructions how to apply it. Don't have any setup to build KDE from source.
Comment 10 Wolfgang Illmeyer 2022-12-29 12:44:00 UTC
I tried your fix on the master branch and it solved the problem for me.
Comment 11 Christoph Cullmann 2022-12-29 13:08:37 UTC
(In reply to Wolfgang Illmeyer from comment #10)
> I tried your fix on the master branch and it solved the problem for me.

Thanks a lot for the testing.
Comment 12 Christoph Cullmann 2022-12-29 13:26:24 UTC
Git commit 4082f64a9695287ee87c712ef1287fabe8ee8c9b by Christoph Cullmann.
Committed on 29/12/2022 at 13:26.
Pushed by cullmann into branch 'master'.

Fix session restore for KWrite

M  +6    -2    apps/lib/katemainwindow.cpp
M  +6    -1    apps/lib/katemainwindow.h
M  +4    -10   apps/lib/kateviewmanager.cpp
M  +3    -1    apps/lib/session/katesessionmanager.cpp

https://invent.kde.org/utilities/kate/commit/4082f64a9695287ee87c712ef1287fabe8ee8c9b
Comment 13 Christoph Cullmann 2022-12-29 13:33:51 UTC
Git commit a6c64ff86e9815b3f719880442dd9242f60380e6 by Christoph Cullmann.
Committed on 29/12/2022 at 13:33.
Pushed by cullmann into branch 'release/22.12'.

Fix session restore for KWrite


(cherry picked from commit 4082f64a9695287ee87c712ef1287fabe8ee8c9b)

M  +6    -2    apps/lib/katemainwindow.cpp
M  +6    -1    apps/lib/katemainwindow.h
M  +4    -10   apps/lib/kateviewmanager.cpp
M  +3    -1    apps/lib/session/katesessionmanager.cpp

https://invent.kde.org/utilities/kate/commit/a6c64ff86e9815b3f719880442dd9242f60380e6
Comment 14 Christoph Cullmann 2023-01-02 17:56:13 UTC
*** Bug 463720 has been marked as a duplicate of this bug. ***