After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766808 - Cannot open new Nautilus window with middle click from Dash
Cannot open new Nautilus window with middle click from Dash
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: general
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 783934 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-05-23 16:01 UTC by franglais125
Modified: 2018-11-25 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description franglais125 2016-05-23 16:01: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.
Comment 1 franglais125 2016-06-21 03:36:50 UTC
I don't know how much this can help, but removing "DBusActivatable=true" from the .desktop file solves the issue.
Comment 2 jeremy9856 2016-08-05 09:43:25 UTC
I experience this bug too. Thanks !
Comment 3 franglais125 2016-09-21 21:43:33 UTC
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.
Comment 4 Carlos Soriano 2016-09-22 12:39:44 UTC
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
Comment 5 jeremy9856 2016-09-22 13:31:52 UTC
Is it not possible to simply detect that it's a middle click and thus always open a new  windows ?
Comment 6 Carlos Soriano 2016-09-22 13:36:09 UTC
(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.
Comment 7 jeremy9856 2016-09-22 14:12:19 UTC
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
Comment 8 Michael Catanzaro 2016-09-22 14:17:17 UTC
(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.
Comment 9 Carlos Soriano 2016-09-22 14:18:29 UTC
(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.
Comment 10 Michael Catanzaro 2016-09-22 14:18:44 UTC
(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.
Comment 11 Carlos Soriano 2016-09-22 14:20:25 UTC
(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.
Comment 12 franglais125 2016-09-22 15:37:45 UTC
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
Comment 13 Florian Müllner 2016-09-22 17:12:30 UTC
(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.
Comment 14 Carlos Soriano 2016-09-22 18:23:26 UTC
(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).
Comment 15 franglais125 2016-09-22 18:43:51 UTC
Thanks a lot for the effort and info!

I guess that's where my helpfulness ends really.
Comment 16 Ernestas Kulik 2017-06-19 07:40:33 UTC
*** Bug 783934 has been marked as a duplicate of this bug. ***
Comment 17 franglais125 2017-06-20 20:04:14 UTC
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
Comment 18 Florian Müllner 2017-06-20 21:26:09 UTC
See bug 756844.
Comment 19 António Fernandes 2018-11-25 16:51:02 UTC
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.