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 763221 - [PATCH] Add Duplicate Tab feature
[PATCH] Add Duplicate Tab feature
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Tabs
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-07 12:21 UTC by Gabriel Ivașcu
Modified: 2016-03-29 18:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add Duplicate Tab window command (3.36 KB, patch)
2016-03-07 12:21 UTC, Gabriel Ivașcu
committed Details | Review

Description Gabriel Ivașcu 2016-03-07 12:21:05 UTC
Created attachment 323260 [details] [review]
Add Duplicate Tab window command

I find Duplicate Tab a nice feature of Chrome browser and I think Epiphany users could find it useful too.

How to use it: right click a tab -> Duplicate.

A new tab with the same content will be opened to the right of the original one. The duplicate tab will gain focus.
Comment 1 Michael Catanzaro 2016-03-07 12:44:04 UTC
Review of attachment 323260 [details] [review]:

Looks good to me, for 3.22 at this point

::: src/window-commands.c
@@ +1601,3 @@
+			   EphyWindow *window)
+{
+	EphyEmbed *embed, *new_embed;

Even if this style is used elsewhere in this file, please limit yourself to one declaration per line in new code.

@@ +1605,3 @@
+	WebKitWebViewSessionState *session_state;
+
+	embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));

I think it's safer to get the embed from the GtkNotebook instead; you're relying on the fact that right-click focuses the tab, but I'm not sure that will always be the case.
Comment 2 Gabriel Ivașcu 2016-03-07 13:47:13 UTC
(In reply to Michael Catanzaro from comment #1)
> Review of attachment 323260 [details] [review] [review]:
> 
> you're relying on the fact that right-click focuses the tab, but I'm not sure > that will always be the case.

Isn't this what detach and move tab left/right do too?
Comment 3 Michael Catanzaro 2016-03-07 15:23:20 UTC
(In reply to Gabriel Ivascu from comment #2)
> (In reply to Michael Catanzaro from comment #1)
> > Review of attachment 323260 [details] [review] [review] [review]:
> > 
> > you're relying on the fact that right-click focuses the tab, but I'm not sure > that will always be the case.
> 
> Isn't this what detach and move tab left/right do too?

Detach does use ephy_embed_container_get_active_child(), for example, but it's not available from the context menu. Most of the commands in this file that use ephy_embed_container_get_active_child() are actually in the window menu, where this would never be a problem.

But you're right, move left/right have the same problem; even though they don't use ephy_embed_container_get_active_child(), they do use gtk_notebook_get_current_page(). So this is no new problem, don't worry about it. Iulian will probably have to refactor this code during the summer if he picks the bookmarks project, it can be his problem. >:)
Comment 4 Michael Catanzaro 2016-03-07 15:24:12 UTC
Review of attachment 323260 [details] [review]:

(Note: haven't tested this myself yet.)
Comment 5 Michael Catanzaro 2016-03-29 18:26:15 UTC
Attachment 323260 [details] pushed as b46bb84 - Add Duplicate Tab window command