Bug 470050 - Dolphin does not restore folders when opened through session restore
Summary: Dolphin does not restore folders when opened through session restore
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 23.04.1
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 469868 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-20 15:37 UTC by Kishore Gopalakrishnan
Modified: 2023-05-26 16:43 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.04.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2023-05-20 15:37:45 UTC
SUMMARY
When Dolphin 23.04.1 is restored by resuming an activity or rebooting (with session restoration enabled), it always shows the default directory (user's home), instead of showing the folders that were open when the activity was saved or the computer was shut down.

STEPS TO REPRODUCE
Situation A
1. In a fresh activity, open Dolphin and navigate to any directory other than the default
2. Suspend the activity
3. Resume the activity

Situation B
1. In System Settings > Startup and Shutdown > Desktop Session, pick the option to restore applications from last session
2. Open a Dolphin window and navigate to any directory other than the default
3. Reboot and log in

OBSERVED RESULT
A Dolphin window opens in the correct virtual desktop/activity, but it just shows the default directory (user's home).

EXPECTED RESULT
Session restore should restore the folders that were open in the dolphin windows.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.3.1-arch2-1 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Downgrading to 23.04.0 fixes the issue

Git bisect output:

d19800c69198b904ae47cb1e53dfe28f74618eb2 is the first bad commit
commit d19800c69198b904ae47cb1e53dfe28f74618eb2
Author: Méven Car <meven.car@kdemail.net>
Date:   Thu Apr 20 08:50:40 2023 +0000
    Restrict attaching instances to those on the same activity or same virtual desktop
     
    CCBUG: 408919
    (cherry picked from commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85)

 src/dolphinmainwindow.cpp | 25 +++++++++++++++++++++++++
 src/dolphinmainwindow.h   |  3 +++
 src/global.cpp            | 44 +++++++++++++++++++++++++++++++++-----------
 3 files changed, 61 insertions(+), 11 deletions(-)
Comment 1 Antonio Rojas 2023-05-20 22:05:45 UTC

*** This bug has been marked as a duplicate of bug 469656 ***
Comment 3 Aleksey Kontsevich 2023-05-21 16:51:24 UTC
*** Bug 469868 has been marked as a duplicate of this bug. ***
Comment 4 Kishore Gopalakrishnan 2023-05-23 11:48:57 UTC
(In reply to Méven Car from comment #2)
> MR https://invent.kde.org/system/dolphin/-/merge_requests/550

That does not seem to fix the issue on my machine (tested situation A).
Comment 5 Bug Janitor Service 2023-05-23 18:35:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/550
Comment 6 mlchatnoir666 2023-05-23 20:45:12 UTC
I am currently experiencing the same bug.

If it can help, I see the default home folder when I open dolphin manually (clicking on the app) and when my computer opens dolphin on start, BUT I see the saved state when another app opens dolphin. Not sure why the behavior is different depending on the case
Comment 7 mlchatnoir666 2023-05-23 20:54:26 UTC
(In reply to mlchatnoir666 from comment #6)
> I am currently experiencing the same bug.
> 
> If it can help, I see the default home folder when I open dolphin manually
> (clicking on the app) and when my computer opens dolphin on start, BUT I see
> the saved state when another app opens dolphin. Not sure why the behavior is
> different depending on the case

as seen in https://bugs.kde.org/show_bug.cgi?id=469656 , the bug doesn't happen if you open dolphin with the shortcut (default Meta+E in Plasma). I'm just reposting for others since it's a valid workaround