[Xfce4-commits] <midori:master> Notify page re-ordering adding/ removing Granite tabs

Christian Dywan noreply at xfce.org
Sat Feb 2 02:16:02 CET 2013


Updating branch refs/heads/master
         to 996998f3fa9f43b4a920630ad66ce9727fb4b2ce (commit)
       from 3611f1ba163e6be2c879fe4cd7cc7c6e02ce3d0e (commit)

commit 996998f3fa9f43b4a920630ad66ce9727fb4b2ce
Author: Corentin Noël <tintou at mailoo.org>
Date:   Sat Feb 2 02:03:33 2013 +0100

    Notify page re-ordering adding/ removing Granite tabs
    
    Fixes: https://bugs.launchpad.net/midori/+bug/1082786

 midori/midori-browser.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index b229e9e..987176a 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -4972,12 +4972,17 @@ midori_browser_notebook_tab_added_cb (GtkWidget*         notebook,
                                       GraniteWidgetsTab* tab,
                                       MidoriBrowser*     browser)
 {
+    gint n = granite_widgets_dynamic_notebook_get_tab_position (
+        GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (notebook), tab);
+    midori_browser_set_current_page (browser, n);
     GtkWidget* view = midori_view_new_with_item (NULL, browser->settings);
     midori_view_set_tab (MIDORI_VIEW (view), tab);
     midori_browser_connect_tab (browser, view);
+    midori_view_set_uri (MIDORI_VIEW (view), "");
     /* FIXME: signal add-tab */
     _midori_browser_update_actions (browser);
-    midori_view_set_uri (MIDORI_VIEW (view), "");
+    midori_browser_notebook_page_reordered_cb (GTK_WIDGET (notebook),
+        MIDORI_VIEW (view), n, browser);
 }
 
 static gboolean
@@ -4988,6 +4993,13 @@ midori_browser_notebook_tab_removed_cb (GtkWidget*         notebook,
     MidoriView* view = MIDORI_VIEW (granite_widgets_tab_get_page (tab));
     if (midori_browser_tab_connected (browser, MIDORI_VIEW (view)))
         midori_browser_disconnect_tab (browser, MIDORI_VIEW (view));
+
+    GraniteWidgetsTab* new_tab = granite_widgets_dynamic_notebook_get_current (
+        GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (notebook));
+    gint new_pos = granite_widgets_dynamic_notebook_get_tab_position (
+        GRANITE_WIDGETS_DYNAMIC_NOTEBOOK (notebook), new_tab);
+    midori_browser_switched_tab (browser, granite_widgets_tab_get_page (tab),
+        MIDORI_VIEW (granite_widgets_tab_get_page (new_tab)), new_pos);
     return TRUE;
 }
 


More information about the Xfce4-commits mailing list