Restore session if this is the first instance

  1. Restore session if this is the first instance even with "new-window" option.

    Otherwise, if Dolphin has not been opened before, and a program (such as browsers or Kate) that launch Dolphin with "new-window" option will start Dolphin, it opens only with one tab and closes the user's previous session.

    With this patch, the behavior is similar to how the first instance of browsers opens with setting for tab recovery enabled.

    Also restore sessions if this is restoring multiple instances with session restoration after reboot enabled.

  2. Dolphin should not restore all tabs for additional instances.

    This is especially noticeable if the "Keep a single Dolphin window, opening new folders in tabs" checkbox is turned off, and when the Dolphin window is already open (with several tabs), folders from the desktop (plasmashell) are opened by double-clicking. Desktop opens a new Dolphin window with the tabs restored and an open folder at the end.

  3. The presence of the daemon Dolphin process among the list of processes does not affect the determination of the "first" instance of the window, since daemon is excluded from the list of GUI instances by the first commit.

BUG: 464693

CCBUG: 448707

CCBUG: 469271

Test-cases

Click to expand

Tested on X11 and Wayland (Plasma 6.6.80 + Frameworks 6.25.0).

Next, the "Keep a single Dolphin window, opening new folders in tabs" checkbox will be called 'new folders in tabs' for short.

  1. Opening via an external application

    1.1 The Dolphin was already open, 'new folders in tabs' is disabled

    Before and after: a separate window opens with one tab

    1.2 The Dolphin was not open, 'new folders in tabs' is disabled

    Before: the previous session was lost, a window opens with only one tab (bug 464693)

    After: a new window opens in which the session is restored and a new tab is added

    1.3 The Dolphin was already open, 'new folders in tabs' is enabled

    Before and after: a new folder opens as a new tab in the current window

    1.4 The Dolphin was not open, 'new folders in tabs' is enabled

    Before: the previous session was lost, a window opens with only one tab (bug 464693)

    After: a new window opens in which the session is restored and a new tab is added

  2. Via terminal - dolphin /tmp or by double-click on Desktop

    2.1 The Dolphin was already open, 'new folders in tabs' is disabled

    Before: another window opens in which the session is restored and a new tab is added (bugs 448707 and 469271).

    After: another window opens with only one tab

    2.2 The Dolphin was not open, 'new folders in tabs' is disabled

    Before and after: a new window opens in which the session is restored and a new tab is added

    2.3 The Dolphin was already open, 'new folders in tabs' is enabled

    Before and after: a new folder opens as a new tab in the current window

    2.4 The Dolphin was not open, 'new folders in tabs' is enabled

    Before and after: a new window opens in which the session is restored and a new tab is added

  3. Via terminal - dolphin --new-window /tmp

    Here checkbox 'new folders in tabs' does not affect anything.

    3.1 The Dolphin was already open, 'new folders in tabs' is disabled

    Before and after: a separate window opens with one tab

    3.2 The Dolphin was not open, 'new folders in tabs' is disabled

    Before: the previous session was lost, a window opens with only one tab (bug 464693)

    After: a new window opens in which the session is restored and a new tab is added

    3.3 The Dolphin was already open, 'new folders in tabs' is enabled

    Before and after: a separate window opens with one tab

    3.4 The Dolphin was not open, 'new folders in tabs' is enabled

    Before: the previous session was lost, a window opens with only one tab (bug 464693)

    After: a new window opens in which the session is restored and a new tab is added

  4. Opening multiple windows and restarting the session with session restoration after reboot enabled

    Before and after: on X11, all Dolphin windows are restored with the tabs that were opened in them.

    For some reason, only one window is being restored on Wayland (even before patch) - however, I did not test it on the master branch, but on Plasma 6.6.80 + Frameworks 6.25.0, and on 6.5.5 + 6.23.0.

    I'll write a bug report, if it doesn't exist yet, when I check this with KDE components on the master branch.

    https://bugs.kde.org/show_bug.cgi?id=520071

Edited by Sergey Katunin

Merge request reports

Loading