From: Christian Dywan Date: Fri, 22 May 2009 21:15:53 +0000 (+0200) Subject: Add tabs to new browser windows *after* emitting NEW_WINDOW X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56d2637020ef1055d3f72997ba3a3c7a504b3ff4;p=midori Add tabs to new browser windows *after* emitting NEW_WINDOW The app takes care of settings as well as other state when the NEW_WINDOW signal of a browser is emitted. So we need to add tabs after emitting the signal, otherwise the new tab has default settings for a limited period of time. --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 510f003b..d955917f 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -1100,8 +1100,8 @@ midori_view_new_window_cb (GtkWidget* view, MidoriBrowser* browser) { MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL); - midori_browser_add_uri (new_browser, uri); g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser); + midori_browser_add_uri (new_browser, uri); } static void @@ -1113,9 +1113,9 @@ midori_view_new_view_cb (GtkWidget* view, if (where == MIDORI_NEW_VIEW_WINDOW) { MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL); + g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser); midori_browser_add_tab (new_browser, new_view); midori_browser_set_current_tab (new_browser, new_view); - g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser); } else { @@ -1849,8 +1849,8 @@ _action_window_new_activate (GtkAction* action, MidoriBrowser* browser) { MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL); - midori_browser_add_uri (new_browser, ""); g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser); + midori_browser_add_uri (new_browser, ""); } static void @@ -3177,8 +3177,8 @@ midori_browser_bookmark_open_in_window_activate_cb (GtkWidget* menuitem, if (uri && *uri) { MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL); - midori_browser_add_uri (new_browser, uri); g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser); + midori_browser_add_uri (new_browser, uri); } }