[Xfce4-commits] <midori:master> Reflect tab order in saved session

Christian Dywan noreply at xfce.org
Sat Feb 19 22:48:01 CET 2011


Updating branch refs/heads/master
         to 85e78eab9ae36f0a20afcc749d2cae746b770de5 (commit)
       from 8310abdf4476a21082e49d3d0c8578fc93606018 (commit)

commit 85e78eab9ae36f0a20afcc749d2cae746b770de5
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Feb 19 22:22:52 2011 +0100

    Reflect tab order in saved session
    
    Discussed, tested and tweaked by amphi, ml| and MonkeyofDoom in IRC.

 midori/midori-browser.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 8a03fc4..087869a 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -1551,6 +1551,8 @@ _midori_browser_add_tab (MidoriBrowser* browser,
     item = midori_view_get_proxy_item (MIDORI_VIEW (view));
     g_object_ref (item);
     katze_array_add_item (browser->proxy_array, item);
+    katze_array_move_item (browser->proxy_array, item,
+         gtk_notebook_get_current_page (notebook) + 1);
 
     g_object_connect (view,
                       "signal::notify::icon",
@@ -1596,11 +1598,16 @@ _midori_browser_add_tab (MidoriBrowser* browser,
     if (!g_object_get_data (G_OBJECT (view), "midori-view-append") &&
         katze_object_get_boolean (browser->settings, "open-tabs-next-to-current"))
     {
-        n = gtk_notebook_get_current_page (notebook);
-        gtk_notebook_insert_page (notebook, view, tab_label, n + 1);
+        n = gtk_notebook_get_current_page (notebook) + 1;
+        gtk_notebook_insert_page (notebook, view, tab_label, n);
+        katze_array_move_item (browser->proxy_array, item, n);
     }
     else
+    {
         gtk_notebook_append_page (notebook, view, tab_label);
+        katze_array_move_item (browser->proxy_array, item,
+                               gtk_notebook_get_n_pages (notebook));
+    }
 
     gtk_notebook_set_tab_reorderable (notebook, view, TRUE);
     gtk_notebook_set_tab_detachable (notebook, view, TRUE);



More information about the Xfce4-commits mailing list