GNOME Bugzilla – Bug 766808
Cannot open new Nautilus window with middle click from Dash
Last modified: 2018-11-25 16:51:02 UTC
OS: Debian Testing, Fedora 24 Beta Gnome: 3.20 Nautilus: 3.20.1 It is no longer possible to open a new Nautilus window from the dash when using the middle-click button. This happens when another Nautilus window is open on the default directory. This is very similar to bug https://bugzilla.gnome.org/show_bug.cgi?id=756370, except that the trigger is not the context menu, but middle-clicking on Nautilus. Behaviour observed: 1) If no Nautilus window is open, middle-clicking on dash opens a new one. 2) If a window is open, but not in the default directory, middle-clicking on dash opens a new one. 3) If a window is open and has a tab on the default directory, then focus is shifted to that window and that tab. It will even change workspace if necessary. Similarly, it affects extensions that make use of something like "app.open_new_window(-1)". E.g. https://extensions.gnome.org/extension/413/dash-hotkeys/ when using Shift+Super to open a new window. I do not see this problem when launching "nautilus --new-window" from the terminal.
I don't know how much this can help, but removing "DBusActivatable=true" from the .desktop file solves the issue.
I experience this bug too. Thanks !
I can now confirm this problem with Nautilus 3.22. I would mark it as such but I see no option above for that. 3.21 is the oldest version available in the drop-down menu.
This cannot be fixed, either we open a new window on every activate, or we focus the current window. For legacy reason we have the --new-window switch, so that makes it explicit when to do that or not. So either we remove that and always open a new window, or it works as currently works. Current behaviour is described here https://bugzilla.gnome.org/show_bug.cgi?id=756370#c18
Is it not possible to simply detect that it's a middle click and thus always open a new windows ?
(In reply to jeremy9856 from comment #5) > Is it not possible to simply detect that it's a middle click and thus always > open a new windows ? That's not the problem. The problem is, how we tell the application to open a new window? It's not that we have a spec for that, neither that even if we would chrome or firefox or other 3rd party apps would implement it.
According to you, since it seems that it's not possible to have a spec for that why not just make Nautilus always open a new windows when it detect a middle click ? Sorry if I don't get it but I really don't see what prevent you to do something like that :D
(In reply to Carlos Soriano from comment #6) > That's not the problem. The problem is, how we tell the application to open > a new window? It's not that we have a spec for that, neither that even if we > would chrome or firefox or other 3rd party apps would implement it. I think GtkApplication activate is expected to show a new window in multi-window apps, and the shell expects that to work if you have a New Window GAction? Maybe the shell should just be calling New Window directly instead? I'd ask Florian or Giovanni.
(In reply to jeremy9856 from comment #7) > According to you, since it seems that it's not possible to have a spec for > that why not just make Nautilus always open a new windows when it detect a > middle click ? > > Sorry if I don't get it but I really don't see what prevent you to do > something like that :D No worries at all. Nautilus middle click? This is about the dash of gnome-shell (or unity or a terminal, or whatever who is activating the application). That's not Nautilus. Nautilus it's only the window you see with the icons etc. Nothing else outside of that.
(In reply to jeremy9856 from comment #7) > According to you, since it seems that it's not possible to have a spec for > that why not just make Nautilus always open a new windows when it detect a > middle click ? Nautilus doesn't know anything about the middle click; GNOME Shell decides how to launch the application. I haven't looked at the code because I'm lazy, but I think the D-Bus function that GNOME Shell expects to show a new window just doesn't do that in Nautilus.
(In reply to Michael Catanzaro from comment #8) > (In reply to Carlos Soriano from comment #6) > > That's not the problem. The problem is, how we tell the application to open > > a new window? It's not that we have a spec for that, neither that even if we > > would chrome or firefox or other 3rd party apps would implement it. > > I think GtkApplication activate is expected to show a new window in > multi-window apps, and the shell expects that to work if you have a New > Window GAction? Maybe the shell should just be calling New Window directly > instead? I'd ask Florian or Giovanni. Hey, no, activate it's not expected to do that (why we would have --new-window in Nautilus. Although this predates GAction). It's up to the application what to do. If you have a new-window action, gnome-shell stills calls just activate :) which is the main problem. No worries about asking Florian, it has been a topic we already discussed in the past, and we are discussing it again right now in #gnome-shell. We will probably have a fix on gnome-shell side.
Well, I had prepared a detailed answer, but for whatever reason it never got through. Now the conversation has seen some developments. Here are some remaining relevant bits of what I had written: First: thanks for getting back to us! Second: As I said before, removing "DBusActivatable=true" from the .desktop file solves the issue, but I don't know what all the implications are of removing that. Is it a safe workaround for now? Third: This is the exact line that explicitly requests the app to open a new window when using Middle Click [or Ctrl+Click]: https://git.gnome.org/browse/gnome-shell/tree/js/ui/appDisplay.js#n1760 It seems that Nautilus doesn't honour "this.app.open_new_window(-1);". I've tried explicitly executing that line through extensions (Dash-To-Dock, etc.) to no avail (again, except if the DBus line is removed from the .desktop file). Regards, and thanks in advance, Fran
(In reply to Carlos Soriano from comment #11) > No worries about asking Florian, it has been a topic we already discussed in > the past, and we are discussing it again right now in #gnome-shell. We will > probably have a fix on gnome-shell side. I attached a patch in bug 756844.
(In reply to franglais125 from comment #12) > Well, I had prepared a detailed answer, but for whatever reason it never got > through. Now the conversation has seen some developments. Here are some > remaining relevant bits of what I had written: > > First: thanks for getting back to us! > > Second: As I said before, removing "DBusActivatable=true" from the .desktop > file solves the issue, but I don't know what all the implications are of > removing that. Is it a safe workaround for now? > > Third: This is the exact line that explicitly requests the app to open a new > window when using Middle Click [or Ctrl+Click]: > https://git.gnome.org/browse/gnome-shell/tree/js/ui/appDisplay.js#n1760 > It seems that Nautilus doesn't honour "this.app.open_new_window(-1);". I've > tried explicitly executing that line through extensions (Dash-To-Dock, etc.) > to no avail (again, except if the DBus line is removed from the .desktop > file). > > Regards, and thanks in advance, > Fran Since you invested the time to dig into it...I will explain. What you see is a C API in shell-app.c. If you look at the code you will see that we actually just call activate after all https://git.gnome.org/browse/gnome-shell/tree/src/shell-app.c#n538 . Nothing to do with Nautilus at all. If you remove dbus activation it works because it's literally executing the same app twice, they don't share dbus (afaik).
Thanks a lot for the effort and info! I guess that's where my helpfulness ends really.
*** Bug 783934 has been marked as a duplicate of this bug. ***
I had forgotten about this bug... I don't know how relevant this is, but it is working fine in dash-to-dock now. I'm not saying it's a clean fix, but it's pretty seamless from a user point of view. https://github.com/micheleg/dash-to-dock/commit/168e7eb49c41f46a0be3dad79e6f80c1f80321a4
See bug 756844.
A new window can be opened with a middle click in gnome-shell 3.30. https://gitlab.gnome.org/GNOME/gnome-shell/commit/3efd296fc322c7ddf3f544595c2d31e467ecd393 The original user-visible bug has been fixed, so I'm closing this.