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 745792 - When launched with URI, opens 2 tabs instead of just one
When launched with URI, opens 2 tabs instead of just one
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 753730 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-03-07 14:03 UTC by Bastien Nocera
Modified: 2015-08-31 15:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not open an extra overview when starting the browser (1.96 KB, patch)
2015-03-07 21:04 UTC, Michael Catanzaro
none Details | Review
Do not open an extra overview when starting the browser (1.91 KB, patch)
2015-03-07 23:55 UTC, Michael Catanzaro
committed Details | Review

Description Bastien Nocera 2015-03-07 14:03:27 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.
Comment 1 Michael Catanzaro 2015-03-07 19:46:46 UTC
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.
Comment 2 Bastien Nocera 2015-03-07 20:11:51 UTC
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...
Comment 3 Michael Catanzaro 2015-03-07 21:04:45 UTC
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.
Comment 4 Bastien Nocera 2015-03-07 21:22:23 UTC
I do have restore session set to always, I didn't change it from the default.
Comment 5 Michael Catanzaro 2015-03-07 23:51:33 UTC
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).
Comment 6 Michael Catanzaro 2015-03-07 23:55:25 UTC
Created attachment 298788 [details] [review]
Do not open an extra overview when starting the browser

Just changes the commit message a bit
Comment 7 Michael Catanzaro 2015-08-21 22:18:32 UTC
*** Bug 753730 has been marked as a duplicate of this bug. ***
Comment 8 Michael Catanzaro 2015-08-30 14:00:57 UTC
Pinging reviewers
Comment 9 Carlos Garcia Campos 2015-08-31 06:49:32 UTC
Review of attachment 298788 [details] [review]:

Ok, let's try this way. Thanks
Comment 10 Michael Catanzaro 2015-08-31 15:31:38 UTC
Attachment 298788 [details] pushed as 4ca650b - Do not open an extra overview when starting the browser