GNOME Bugzilla – Bug 745792
When launched with URI, opens 2 tabs instead of just one
Last modified: 2015-08-31 15:31:41 UTC
epiphany-3.15.1-2.fc22.x86_64 When "Force new windows to be opened in tabs" (new-windows-in-tabs) is set and Epiphany isn't running (its last window was closed with Ctrl+W), clicking on a link in Evolution will launch Epiphany with 2 tabs, one with the "most visited" and one with the link. There should be only one tab.
If you don't have a saved session, OK. This is probably a regression from 0b9fdf677e37eb508e119bf236ad86aa6e0daf8b. The problem is tab_is_empty in ephy-shell.c; the tab should be considered empty if it's about:overview or about:blank, but if the page is loading we say it is not. I bet pages will disappear randomly when opening the browser if you do have a saved session and we remove that check, so this requires some thought to fix.
I close the last tab with Ctrl+W. I would expect this to mean that I'm removing all the items from the session, and it should be empty next time. If I were to quit the application after using Ctrl+Q or the Quit menu item, that last tab should still be in the session. I'm not sure what's supposed to happen when you close the last tab with the window close button though...
Created attachment 298786 [details] [review] Do not open an extra overview when starting the browser If there is no saved session (e.g. if restore-session-policy is not always) and the user launches Epiphany by clicking a URI in another application, then we should open only one tab with that URI. Currently we may open the overview and then the URI in a second tab, because we do not consider the page to be blank if it is still loading. Avoid this tricky code, since if the page is still loading it's not safe to assume the URI has been set to whatever page was last loaded in it, and we can't risk losing tabs from a previous session. P.S. I assumed from your bug report that you are using restore-session-policy != always, because otherwise you would have to manually load the overview in a tab and close all other tabs to trigger this. But from your last comment I am no longer sure, since now it sounds like you are reloading your session. Anyway this patch fixes the issue you reported in comment #0 with restore-session-policy != always. If the overview was explicitly saved in the user's session on account of being open in the browser when it was last closed, it will still be opened triggering the same behavior as reported in this bug, but otherwise it won't be opened after this patch. Test by launching any app in jhbuild and clicking on the link (e.g. in the about dialog) so that you launch a new instance of jhbuild epiphany rather than system epiphany.
I do have restore session set to always, I didn't change it from the default.
OK, using Ctrl+W the overview can appear even if it was not saved in the session, so I think my patch still works for you. Indeed, closing with Ctrl+W and Ctrl+Q are different. The close button in the header bar seems equivalent to Ctrl+Q (which seems right because it's safer: no unexpectedly lost tab unless you use Ctrl+W).
Created attachment 298788 [details] [review] Do not open an extra overview when starting the browser Just changes the commit message a bit
*** Bug 753730 has been marked as a duplicate of this bug. ***
Pinging reviewers
Review of attachment 298788 [details] [review]: Ok, let's try this way. Thanks
Attachment 298788 [details] pushed as 4ca650b - Do not open an extra overview when starting the browser