Bug 469271 - Double click on folder from desktop opens not only that folder but also random unrelated ones
Summary: Double click on folder from desktop opens not only that folder but also rando...
Status: REOPENED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 22.12.3
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-02 15:30 UTC by php4fan
Modified: 2024-10-07 15:24 UTC (History)
4 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 php4fan 2023-05-02 15:30:10 UTC
STEPS TO REPRODUCE
1. Close all Dolphin windows
2. Open a new dolphin window, and in it, several tabs where you open several folders, let's say they are folders X, Y and Z
3. Create two folders in your Desktop: call them A and B
4. Double click on folder A in the desktop.
=> this opens a new Dolphin window with a single tab (or no tabs depending on how you call it) with folder A (so now you have two Dolphin windows open, one with several tabs showing folders X, Y, Z, and one with only one tab showing folder A)
5. Close the Dolphin window that is showing folder A
6. From the desktop, double-click on folder B

EXPECTED RESULT

This should open a new Dolphin window, with only one tab (or no tabs depending on how you want to call it) showing the contents of folder B

OBSERVED RESULT

The new folder window has two tabs, with folders A and B. Dolphin remembers the folders that you have opened as tabs in the last Dolphin window that you closed, and reopens all of them in addition to the new one you double-clicked.

You can now repeat, by closing this new window, and double-clicking on a third folder C from the desktop, and the newly opened window will have three tabs with folders A, B and C.

And this will happen even if in the meantime you have deleted some of the folders. You'll have a Dolphin window with tabs for folders that no longer exist!!


This is a regression that appeared relatively recently, like a few months ago or so. I was too lazy to report it until now, but I hit it every single day every few minutes and it's tremendously annoying and confusing. It kills productivity and makes my life miserable.

I haven't found any workaround to avoid this. Every time I close the window opened from the desktop, I previously make sure to close every single tab in it, so that at least it doesn't accumulate an infinitely growing number of tabs. But this doesn't prevent me from always systematically having two tabs instead of one every time (and having to close them one by one so I don't get three next time).




Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.1.23-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 7.3 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Plus Graphics
Manufacturer: LENOVO
Product Name: 81WE
System Version: IdeaPad 3 15IIL05
Comment 1 Alfonso Murolo 2023-05-02 18:56:38 UTC
I could reproduce this on Arch. 
It is, to my eyes, kind-of intended since in the settings of Dolphin there is one which seems to control exactly this.
I am wondering however what is the rationale behind a *default* of reopening the tabs of the last process.. can anybody shed some light?
I admit I find this behaviour slightly odd too.
Comment 2 php4fan 2023-05-02 19:29:51 UTC
> It is, to my eyes, kind-of intended since in the settings of Dolphin there is one which seems to control exactly this.

Are you talking about the one under "Startup -> New windows -> Show on startup"
which has two options:
- Folders, tabs, and window state from last time
- [a specific folder]

But this one also applies when I close all Dolphin windows and then launch Dolphin from scratch. When I do so, of course I do want it to reopen my last window with the tabs that I had in it. If I change that setting, it will apply in this case too, and I don't want that. So that's a reasonable default (but I do see the need for a setting, i.e. I understand why others may prefer to always start from a given folder).

But when I open a new window BY DOUBLE CLICKING ON A SPECIFIC FOLDER on the desktop, it makes no sense to open _additional_ tabs that are from *SOME* previously closed window. Especially when I already have another window open. The concept of "last time" is not even well defined in this situation.

It seems to be using the same setting for unrelated situations.

And indeed I checked that changes this setting does make the issue go away. But again, it's not an acceptable workaround.
Comment 3 php4fan 2023-08-29 14:38:46 UTC
Why is this being ignored?
Comment 4 Jonathan Wakely 2024-01-26 19:17:07 UTC
> Especially when I already have another window open. The concept of "last time" is not even well defined in this situation.

Yeah I think this is the problem. I have a dolphin window that I keep open permanently, with two tabs to a bunch of PDFs that I consult every day (docs like the C and C++ standards). So I definitely want that window to be restored when I start dolphin.

But if I open a second dolphin window, or a third one, or some other application runs "xdg-open /some/path", or I mount a USB drive via the systray applet, I don't want a new window with all the same tabs in it *again*.

I have Firefox set to restore my tabs and windows from last time as well, but if I press Ctrl-N to open a new window it doesn't reopen all those tabs *again*. They're still there in the original window, I don't need them reopened!

If I change dolphin's setting to show $HOME (or some other dir) on startup, then launching a new dolphin window to open a specific dir (e.g. with xdg-open) or mounting a removable drive doesn't open with $HOME in a second tab, it *only* opens the location it was told to open. Why doesn't the "show on startup" setting take effect here too? To be clear, I don't think it should take effect, because that would be silly. But that's exactly what it does when "show on startup" is set to restore the previous state.

I think the sensible behaviour would be to ignore that setting when dolphin is launched to show a specific dir (like when clicking on a folder on the desktop, or mounting a removable drive, or some other app uses xdg-open). Just show the dir it's been asked to show.

If dolphin is launched with no arguments, e.g. from the start menu or the command line, then the "show on startup" would be relevant. That is the action "start dolphin", and not "show dir X in a file manager, which happens to be dolphin". They are two very different use cases.
Comment 5 php4fan 2024-01-26 23:22:21 UTC
This is a regression, it used to behave as expected. There's no need to invent anything, just find what broke it.
Comment 6 php4fan 2024-02-13 18:46:09 UTC
Can we please have this adressed?? This is tremendously annoying.
Comment 7 fanzhuyifan 2024-02-16 06:12:38 UTC
(In reply to php4fan from comment #6)
> Can we please have this adressed?? This is tremendously annoying.

Would you be interested to do a git bisect to figure out the first bad commit? : )
Comment 8 php4fan 2024-02-16 09:55:50 UTC
> Would you be interested to do a git bisect to figure out the first bad commit? : )

If there's a guide for dummies on how to do that I may give it a shot, but given I have to learn from scratch and install all the tools and stuff, I strongly suspect it would take me about 20x the time it would take any of the developers (who probably do git bisects all the time) to do the same thing. Especially considering that anybody can easily reproduce the issue on the current version. At least nobody has said they can't reproduce.
Comment 9 php4fan 2024-04-18 15:37:50 UTC Comment hidden (spam)
Comment 10 php4fan 2024-07-25 15:30:18 UTC Comment hidden (spam)
Comment 11 Jonathan Wakely 2024-07-25 15:47:40 UTC
I suspect that teaching you how to build dolphin from source, and then teaching you how to use git bisect, would *also* take longer than just doing it, so nobody has taken the time to teach you.

(I have no idea how to build dolphin from source, and whether I'd also need to rebuild other things like plasma and kde frameworks along with it, otherwise I'd try the bisection myself.)
Comment 12 php4fan 2024-07-25 16:00:44 UTC
> .... so nobody has taken the time to teach you.

Yeah that was expected. What surprises me is that nobody has taken the time to try the bisection either (or to investigate the issue in any way, it seems).
Comment 13 fanzhuyifan 2024-07-25 16:48:43 UTC
(In reply to php4fan from comment #2)
> > It is, to my eyes, kind-of intended since in the settings of Dolphin there is one which seems to control exactly this.
> 
> Are you talking about the one under "Startup -> New windows -> Show on
> startup"
> which has two options:
> - Folders, tabs, and window state from last time
> - [a specific folder]

Yeah, this is the intended behavior controlled by this setting.
Comment 14 php4fan 2024-07-25 17:00:11 UTC
> Yeah, this is the intended behavior controlled by this setting.

If so, it's intended wrong. See my comment 2.

Has this setting been recently introduced? If it has, then again, it's implemented or designed wrong, as pointed out in comment 2.

If it hasn't, then it means that it used to work properly and this is a regression (I mean this is a regression either way, but if the setting isn't new then it's not due to introducing the setting, or probably even related to it).
Comment 15 Jonathan Wakely 2024-07-25 17:03:14 UTC
Could you explain why that makes sense, referring to comment 4?

Why is "xdg-open this directory in a file manager, which happens to be Dolphin" the same as "Start Dolphin and restore the same session as last time"?

I'm not trying to "start a new Dolphin session" I'm just trying to open a directory in the file manager. Why would I want to open that directory *and get another copy of all the previous tabs* every time I open a directory? That means I end up with several Dolphin windows and all of them have another copy of the same set of tabs, so for the example in comment 0 I get one window with folders A, X, Y, Z, and another window with B, X, Y, Z. Why is this useful? Why would I want X, Y, and Z present **in every dolphin window I start**???

Surely the point of "Folders, tabs and window state from last time" is to restore the state when you first login to the desktop. To, y'know, restore the state. I don't want to keep "restoring" it again and again every time in multiple windows. That's dumb. I already restored it once, thanks.


This behaviour might be intentional, but that doesn't mean it's logical or useful.
Comment 16 Jonathan Wakely 2024-07-25 17:08:39 UTC
(In reply to php4fan from comment #2)
> Are you talking about the one under "Startup -> New windows -> Show on
> startup"
> which has two options:
> - Folders, tabs, and window state from last time
> - [a specific folder]

N.B. the option is NOT nested under New Windows.  There is a radio button for "Show on startup" and a SEPARATE one for "New windows". That seems relevant to me.

The problem seems to be that opening a directory by clicking on the desktop, or running xdg-open, is considered a new session "startup", rather than just opening a new window for *that specific directory only*.

I think there needs to be some "is this the first dolphin window? if so restore the previous session, otherwise open a new window without the previous tabs" logic. So that it doesn't keep "restoring" tabs that are already open in another window.
Comment 17 php4fan 2024-07-25 17:33:39 UTC
> N.B. the option is NOT nested under New Windows.  
> There is a radio button for "Show on startup" and a SEPARATE one for "New windows". 
> That seems relevant to me.

Just to clarify, the settings have changed since I wrote comment 2. 
The setting is now under "Interface -> Folder and Tabs -> Show on startup" (i.e. the very first setting) and it has two possible options (i.e. radio buttons): (A) "Folders, tabs and windows from last time" and (B) the option to select a specific folder.
The "New windows" section that now only comprises a single  checkbox setting is now completely unrelated.
Comment 18 php4fan 2024-10-07 15:24:46 UTC
@fanzhuyifan after all the replies from me and Jonathan Wakely you do now understand that this is an issue, right? What is stopping this from being addressed?

BTW you never confirmed whether or not the setting, that you misunderstood as causing this as expected behavior, was introduced around the time this issue appeared (which is probably a few months before it was reported). Because again, if that is not the case, and the setting already existed long before, then probably this has nothing to do with it and is just a stupid unrelated regression.