GNOME Bugzilla – Bug 685976
Epiphany ignores gnome-shell open-new-window hint
Last modified: 2018-03-26 05:11:43 UTC
In gnome-shell, there are at a number of ways to open a new window for an existing application on a specific workspace. These make working with multiple workspaces reasonably convenient (despite) GNOME's current application-centric direction. Epiphany 3.6.0 does not respect this however, and always opens a new tab in the last used window, regardless of the target desktop. To reproduce: 1. Launch Epiphany 2. Drag the Ephy application icon in the dock to a workspace that does not contain an Epiphany window A new Ephy window should open in the target workspace, but instead a new tab opens in the last used Ephy window. This behaviour seems to be inconsistent with most other GNOME and non-GNOME apps, and was not the case for the majority of the 3.5.x series and earlier, thus is a regression.
OK, so the story is: after *a lot* of complaints we finally made epiphany respect the "always open windows in new tabs" setting in this case too. I think the fact that this is happening to you means you have this setting enabled (you can check org.gnome.epiphany.new-windows-in-tabs). A simple workaround would be to create a launcher that forces new windows (with -n), but reverting this will just make all that bunch of people angry again.
You're right - I have org.gnome.epiphany.new-windows-in-tabs set to true. I set it originally since I want target="_new" links and other popups to open in tabs. That, and opening new windows at the request of the user seems to be two separate preferences. However, I'm genuinely confused as to why people are complaining about Ephy opening new windows when /explicitly/ asked to do so — it's like complaining that hitting Ctrl+N open a new window rather than a new tab. Explicitly asking for a new window is exactly what is happening in these gnome-shell scenarios: 1. Right-click the Ephy icon in the dock and choose "New window" 2. Search for Ephy, and hold down Ctrl when hitting Enter 3. Drag the Ephy icon to a workspace that has no existing Ephy windows In all these cases, regardless of user preferences, a new window should be opened since the user is taking extra effort to ask for just that. For everything else open a tab if new-windows-in-tabs is true, but again that should probably be split into a UI and a web preference. Adding a new launcher with -n won't work, since when there is already an Ephy window open on a workspace and invoke it normally in gnome-shell, I want the existing window to open (consistent with standard gnome-shell behaviour).
*** Bug 686762 has been marked as a duplicate of this bug. ***
Created attachment 231071 [details] [review] Partial fix - open links in new windows if last active window is not in the current workspace The problem described in by the reporter is fixed by this patch. However, if you drag Web's icon or use the 'New window' menu item while on a workspace that has your last active window, then it will open a new tab on that window. I'll try to figure out how gnome-shell tells us it wants a new window. I'm also wondering about using the last active window. If I have a window full of cat pictures in workspace 1, and a window with bugzilla bugs in workspace 2, if I go to ws 1 to look at cats, then come back to ws 2 and, without making the web window which is there active, click a new bugzilla link, then the link will be opened in the web window which is in ws 1. Perhaps it would be better to always look for a window in the current workspace, and if it doesn't exist, then open a new window?
Created attachment 231072 [details] [review] Partial fix - open links in new windows if last active window is not in the current workspace
Created attachment 231081 [details] [review] Opens new windows when no URIs are given for Web to load
FWIW, we had a small chat here in the hackfest and I came up with this page about what we would like to have: https://live.gnome.org/Design/Web/OpeningLinks
Created attachment 231096 [details] [review] Replaces the current last active window heuristic with a "window with the most tabs in the current workspace" heuristic This patch makes 231072 obsolete. It can be easily made to mean 'the window with most tabs', without the 'in the current workspace' restriction, too, just by removing the is_on_current_workspace() check. If we decide to do that, though, I'd like to add a 'always-current-workspace' setting ;)
Created attachment 231141 [details] [review] Replaces the current last active window heuristic with a "window with the most tabs in the current workspace" heuristic Full patch, including the stuff we need from the first
Also consider this bug: https://bugzilla.gnome.org/show_bug.cgi?id=115732
Created attachment 231170 [details] [review] Opens new windows when no URIs are given for Web to load
Created attachment 231172 [details] [review] Replaces the current last active window heuristic with a "window with the most tabs in the current workspace" heuristic
Created attachment 231173 [details] [review] Opens new windows when no URIs are given for Web to load
Review of attachment 231172 [details] [review]: ::: src/ephy-shell.c @@ +1061,3 @@ + EphyWindow *window = NULL; + GList *windows; + GList *iter; Indentation seems to be massively broken in this method. @@ +1063,3 @@ + GList *iter; + + g_return_val_if_fail (EPHY_IS_SHELL (shell), 0); Dude, NULL.
I blame gedit for the indendation. Fixing in emacs now =P
Review of attachment 231173 [details] [review]: I think this makes sense. As we have discussed I really dislike this code, but it's not your fault. We can figure out how to improve it later. ::: src/ephy-session.c @@ +274,3 @@ flags |= EPHY_NEW_TAB_FROM_EXTERNAL; } + if ((options != NULL && strstr (options, "new-window") != NULL)) Why the extra parenthesis?
Left over from a previous try/experiment. <xan> ok
Comment on attachment 231172 [details] [review] Replaces the current last active window heuristic with a "window with the most tabs in the current workspace" heuristic c968c68cabc319896ad4d2096940c9a34d4c13cd
Comment on attachment 231173 [details] [review] Opens new windows when no URIs are given for Web to load b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64
Window with the most open tabs in current workspace? As long as bug 330676 isn't fixed, that would lead to "disappearing" tabs, I'm afraid.
This is a mass NEEDINFO of all Epiphany bugs with no activity in the past three years. I'm going to be automatically closing old bugs to help us focus on current problems. If you feel this bug is still relevant with Epiphany 3.26 or newer, then please leave any comment here so that I know not to close this one.
I don't know if there is anything to do here now. Running 3.28 and with new-windows-in-tabs set to true, points (1) & (2) in comment #2 now seem to be working as expected, and (3) doesn't but its seems to be broken in shell at the moment - it doesn't work for e.g. Nautilus either.