GNOME Bugzilla – Bug 763221
[PATCH] Add Duplicate Tab feature
Last modified: 2016-03-29 18:26:18 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.
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.
(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?
(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. >:)
Review of attachment 323260 [details] [review]: (Note: haven't tested this myself yet.)
Attachment 323260 [details] pushed as b46bb84 - Add Duplicate Tab window command