Bug 408919

Summary: "open externally called folder in new tab" feature should take virtual Desktops and Activities into account
Product: [Applications] dolphin Reporter: Eugene Shalygin <eugene.shalygin+bugzilla.kde>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: ASSIGNED ---    
Severity: major CC: a.saoutkin, asturm, connectbhatta, edzis, elvis.angelaccio, ericsbinaryworld, fdelgado.it, hoperidesalone, jakubby, kde545, kde, keithhacks-kdebug, meven29, meven, micraft.b, nate, nplatis, phd, piotr.mierzwinski, reavertm, reeves.87, sam, tapiwazimunhu18
Priority: HI Keywords: usability
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=383125
Latest Commit: Version Fixed In: Dolphin 23.04.1 on X11; still needs fixing on Wayland

Description Eugene Shalygin 2019-06-19 17:36:38 UTC
SUMMARY

Due to the new feature (#183429), workflow with several screens became extremely inconvinient.

STEPS TO REPRODUCE
1. Open Dolphin on screen A.
2. Switch to screen B.
3. Launch Dolphin explicitly or via other means.
4. Switch back to screen A.

OBSERVED RESULT
There is no dolphin window on screen A. 

EXPECTED RESULT

The Dolphin window for screen A is not spoiled by manipulations on other screens.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: git master
KDE Frameworks Version: git master
Qt Version: 5.12.3

ADDITIONAL INFORMATION

The situation gets even worse when task Plasma task manager shows task from the current screen only.
Comment 1 a.saoutkin 2019-06-19 23:19:10 UTC
Sorry by screen do you mean a physical monitor, or something else?
Comment 2 Eugene Shalygin 2019-06-20 08:44:46 UTC
(In reply to a.saoutkin from comment #1)
> Sorry by screen do you mean a physical monitor, or something else?

Pardon for the vague term. I mean Plasma virtual desktops. Also, it turns out the feature does not work with activities too: launching Dolphin switches to the activity where it is open already.
Comment 3 Nate Graham 2019-06-21 09:32:12 UTC
Yep, we need to make this aware of virtual desktops and activities. There's already an open patch to turn it off, BTW. It should be landing soon enough.
Comment 4 Nate Graham 2019-10-07 03:56:36 UTC
*** Bug 412156 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2019-11-22 13:34:58 UTC
*** Bug 414384 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2019-12-31 01:17:02 UTC
*** Bug 415725 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2020-01-29 03:05:05 UTC
*** Bug 416891 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2020-02-21 06:05:36 UTC
*** Bug 417951 has been marked as a duplicate of this bug. ***
Comment 9 kde545 2020-03-01 23:08:57 UTC
Is there something we can do to expedite the integration of the patch?
Comment 10 Nate Graham 2020-03-04 05:13:32 UTC
There is no patch to expedite. Fixing this turns out to be pretty tricky.
Comment 11 Nate Graham 2020-04-13 01:39:19 UTC
*** Bug 420002 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2020-05-14 19:29:03 UTC
*** Bug 411942 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2020-07-07 23:09:59 UTC
*** Bug 423981 has been marked as a duplicate of this bug. ***
Comment 14 Elvis Angelaccio 2020-08-30 23:40:21 UTC
*** Bug 424996 has been marked as a duplicate of this bug. ***
Comment 15 Bernhard 2020-12-05 17:16:04 UTC
(In reply to Nate Graham from comment #3)
> Yep, we need to make this aware of virtual desktops and activities. There's
> already an open patch to turn it off, BTW. It should be landing soon enough.

I just want to confirm that this is indeed still a problem on current neon unstable, although it may behave differently now:

When opening a directory in a different activity on another virtual desktop, dolphin activates the activity which already has dolphin open and moves the window to the same virtual desktop as you were when launching said directory.
Comment 16 Nate Graham 2021-01-13 19:31:11 UTC
*** Bug 431543 has been marked as a duplicate of this bug. ***
Comment 17 Eduardo 2021-12-01 11:50:42 UTC
I was going to create a new bug for Dolphin <-> Activities interaction, but it seems that this is the place to comment. Please suggest if new bug has to be created. So, here are my 2 issues.

I have one Dolphin window opened in each of my 9 activities, when mounting external LUKS encrypted disk from "Disks & devices", KDE always change the activity and open the mounted directory in some arbitrary Dolphin instance on other activity.
To me the destination activity looks random, every reboot it’s different activity (maybe first dolphin window which was started?).
It should open it in the Dolphin window of the activity I’m currently on.

Similar thing happens when I’m uncompressing a file in Dolphin using right click on the file. It uncompresses the file, switch the activity and focus some other Dolphin window on some other activity not even showing the contents of the uncompressed archive in original nor the wrong activity it switched to.
I think that this actually worked on 5.22.x, but I'm not very sure about this.
Comment 18 Nikos Platis 2022-08-08 07:18:23 UTC
Most people here are reporting the issue with respect to activities, so I would like to affirm that it still holds for virtual desktops as well. 

For me, it happens every time I "mount and open" a new drive, and it opens in a tab on a window which was on a different virtual desktop -- probably never on the one which already resides on my current desktop!

Since KDE promotes so much Activities and Virtual Desktops, maybe this issue should be given some higher priority.
Comment 19 Bug Janitor Service 2023-04-07 11:07:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/529
Comment 20 Varaskkar 2023-04-07 11:11:19 UTC
Nice to hear that!

A few days ago I discovered this issue also happen with Okular. When you open a pdf with Okular, and Okular is in another Virtual Desktop, it's opened another Okular instance instead of open Okular with a new tab.
Comment 21 Méven Car 2023-04-08 08:22:40 UTC
(In reply to Varaskkar from comment #20)
> Nice to hear that!

I am glad.

> 
> A few days ago I discovered this issue also happen with Okular. When you
> open a pdf with Okular, and Okular is in another Virtual Desktop, it's
> opened another Okular instance instead of open Okular with a new tab.

Please report open a bug for okular giving thim this Merge Request (MR) as reference: https://invent.kde.org/system/dolphin/-/merge_requests/529

This will pave the way to standardize this fix to more applications supporting mono-instances mode.

Unfortunately my fix will work only on X11 for now.
Comment 22 Varaskkar 2023-04-08 08:49:07 UTC
(In reply to Méven Car from comment #21)
> Unfortunately my fix will work only on X11 for now.

It's still a big step and we're grateful for it :)

I leave here the link of the new bug created for Okular. Let's hope it reaches the right people and it can be fixed.

https://bugs.kde.org/show_bug.cgi?id=468274
Comment 23 Méven Car 2023-04-20 08:50:52 UTC
Git commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85 by Méven Car.
Committed on 20/04/2023 at 08:50.
Pushed by meven into branch 'master'.

Restrict attaching instances to those on the same activity or same virtual desktop

M  +25   -0    src/dolphinmainwindow.cpp
M  +3    -0    src/dolphinmainwindow.h
M  +33   -11   src/global.cpp

https://invent.kde.org/system/dolphin/commit/b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85
Comment 24 Méven 2023-04-21 09:02:05 UTC
Git commit d19800c69198b904ae47cb1e53dfe28f74618eb2 by Méven Car, on behalf of Méven Car.
Committed on 21/04/2023 at 09:01.
Pushed by meven into branch 'release/23.04'.

Restrict attaching instances to those on the same activity or same virtual desktop
(cherry picked from commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85)

M  +25   -0    src/dolphinmainwindow.cpp
M  +3    -0    src/dolphinmainwindow.h
M  +33   -11   src/global.cpp

https://invent.kde.org/system/dolphin/commit/d19800c69198b904ae47cb1e53dfe28f74618eb2
Comment 25 Maciej Mrozowski 2023-05-13 21:18:12 UTC
(In reply to Méven from comment #24)
> Git commit d19800c69198b904ae47cb1e53dfe28f74618eb2 by Méven Car, on behalf
> of Méven Car.
> Committed on 21/04/2023 at 09:01.
> Pushed by meven into branch 'release/23.04'.
> 
> Restrict attaching instances to those on the same activity or same virtual
> desktop
> (cherry picked from commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85)
> 
> M  +25   -0    src/dolphinmainwindow.cpp
> M  +3    -0    src/dolphinmainwindow.h
> M  +33   -11   src/global.cpp
> 
> https://invent.kde.org/system/dolphin/commit/
> d19800c69198b904ae47cb1e53dfe28f74618eb2

This patch causes +10s delay during dolphin startup when dolphin is compiled without support for acrivities.
See https://bugs.gentoo.org/906170. Reverting it fixes the problem.
Comment 26 Méven Car 2023-05-24 08:46:57 UTC
(In reply to Maciej Mrozowski from comment #25)
> (In reply to Méven from comment #24)
> > Git commit d19800c69198b904ae47cb1e53dfe28f74618eb2 by Méven Car, on behalf
> > of Méven Car.
> > Committed on 21/04/2023 at 09:01.
> > Pushed by meven into branch 'release/23.04'.
> > 
> > Restrict attaching instances to those on the same activity or same virtual
> > desktop
> > (cherry picked from commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85)
> > 
> > M  +25   -0    src/dolphinmainwindow.cpp
> > M  +3    -0    src/dolphinmainwindow.h
> > M  +33   -11   src/global.cpp
> > 
> > https://invent.kde.org/system/dolphin/commit/
> > d19800c69198b904ae47cb1e53dfe28f74618eb2
> 
> This patch causes +10s delay during dolphin startup when dolphin is compiled
> without support for acrivities.

The gentoo issue highlights the line https://invent.kde.org/system/dolphin/-/blob/v23.04.1/src/global.cpp#L169 which is the currentDesktop (aka virtualdesktop) check, it does not concern the activities part of the patch (which are #ifdef).

> See https://bugs.gentoo.org/906170. Reverting it fixes the problem.
Comment 27 Bug Janitor Service 2023-05-24 09:00:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/551
Comment 28 Bug Janitor Service 2023-05-24 09:00:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/551
Comment 29 Méven Car 2023-05-24 10:11:53 UTC
Git commit ee8b71e5568f5a56b886b877d63fb345c96b2cce by Méven Car, on behalf of Méven Car.
Committed on 24/05/2023 at 10:11.
Pushed by meven into branch 'master'.

Revert "Restrict attaching instances to those on the same activity or same virtual desktop"

This reverts commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85.

Reintroduces:

M  +0    -25   src/dolphinmainwindow.cpp
M  +0    -3    src/dolphinmainwindow.h
M  +11   -33   src/global.cpp

https://invent.kde.org/system/dolphin/-/commit/ee8b71e5568f5a56b886b877d63fb345c96b2cce
Comment 30 Méven Car 2023-05-24 10:12:01 UTC
Git commit ee8b71e5568f5a56b886b877d63fb345c96b2cce by Méven Car, on behalf of Méven Car.
Committed on 24/05/2023 at 10:11.
Pushed by meven into branch 'master'.

Revert "Restrict attaching instances to those on the same activity or same virtual desktop"

This reverts commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85.

Reintroduces:

M  +0    -25   src/dolphinmainwindow.cpp
M  +0    -3    src/dolphinmainwindow.h
M  +11   -33   src/global.cpp

https://invent.kde.org/system/dolphin/-/commit/ee8b71e5568f5a56b886b877d63fb345c96b2cce
Comment 31 michael 2023-05-24 16:57:44 UTC
Could someone please explain what the actual fix is merely reverting the previous attempt puts us right back where we started.
Comment 32 Méven 2023-05-26 16:40:30 UTC
(In reply to michael from comment #31)
> Could someone please explain what the actual fix is merely reverting the
> previous attempt puts us right back where we started.

https://invent.kde.org/system/dolphin/-/merge_requests/551

The virtual desktop case can be fixed again but I will wait after 23.04.2 so people can have a safe version again.

But for the KActivities case it may not be possible.

A wayland fix should take time, but should be safer.
Comment 33 Méven 2023-05-27 08:46:58 UTC
Git commit 70d0154adbae71be40ee6961272a7738ee5c9a9e by Méven Car.
Committed on 27/05/2023 at 08:46.
Pushed by meven into branch 'release/23.04'.

Revert "Restrict attaching instances to those on the same activity or same virtual desktop"

This reverts commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85.

Reintroduces:
(cherry picked from commit ee8b71e5568f5a56b886b877d63fb345c96b2cce)

M  +0    -25   src/dolphinmainwindow.cpp
M  +0    -3    src/dolphinmainwindow.h
M  +11   -33   src/global.cpp

https://invent.kde.org/system/dolphin/-/commit/70d0154adbae71be40ee6961272a7738ee5c9a9e
Comment 34 Méven 2023-05-27 08:47:06 UTC
Git commit 70d0154adbae71be40ee6961272a7738ee5c9a9e by Méven Car.
Committed on 27/05/2023 at 08:46.
Pushed by meven into branch 'release/23.04'.

Revert "Restrict attaching instances to those on the same activity or same virtual desktop"

This reverts commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85.

Reintroduces:
(cherry picked from commit ee8b71e5568f5a56b886b877d63fb345c96b2cce)

M  +0    -25   src/dolphinmainwindow.cpp
M  +0    -3    src/dolphinmainwindow.h
M  +11   -33   src/global.cpp

https://invent.kde.org/system/dolphin/-/commit/70d0154adbae71be40ee6961272a7738ee5c9a9e
Comment 35 michael 2023-05-27 14:44:54 UTC
bugzila keeps erroneously closing thos.