From d49d314c0bae451731d1b559d5092f72b56d3fd3 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 23 Jul 2012 21:38:03 +0200 Subject: [PATCH] Avoid -1 to append tabs and use tab page in tab-switched --- midori/midori-browser.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index a7579c09..fb129b6d 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -1801,7 +1801,7 @@ _midori_browser_add_tab (MidoriBrowser* browser, katze_array_move_item (browser->proxy_array, item, n); } else - n = -1; + n = midori_browser_get_n_pages (browser) - 1; katze_item_set_meta_integer (item, "append", -1); #ifdef HAVE_GRANITE @@ -5271,6 +5271,8 @@ midori_browser_switched_tab (MidoriBrowser* browser, if (new_view == NULL) return; + g_return_if_fail (MIDORI_IS_VIEW (new_view)); + uri = g_object_get_data (G_OBJECT (new_view), "midori-browser-typed-text"); if (!uri) uri = midori_view_get_display_uri (new_view); @@ -5351,10 +5353,10 @@ midori_browser_notebook_tab_switched_cb (GraniteWidgetsDynamicNotebook* notebook MidoriBrowser* browser) { gint new_pos = granite_widgets_dynamic_notebook_get_tab_position (notebook, new_tab); - gint old_pos = old_tab ? granite_widgets_dynamic_notebook_get_tab_position (notebook, old_tab) : -1; + midori_browser_switched_tab (browser, - old_tab ? midori_browser_get_nth_tab (browser, old_pos) : NULL, - MIDORI_VIEW (midori_browser_get_nth_tab (browser, new_pos)), new_pos); + old_tab ? granite_widgets_tab_get_page (old_tab) : NULL, + MIDORI_VIEW (granite_widgets_tab_get_page (new_tab)), new_pos); } static void -- 2.39.5