]> spindle.queued.net Git - midori/commitdiff
Don't destroy the current tab if it is last and blank
authorAndré Stösel <andre@stoesel.de>
Tue, 19 Jul 2011 19:57:27 +0000 (21:57 +0200)
committerChristian Dywan <christian@twotoasts.de>
Tue, 19 Jul 2011 20:03:37 +0000 (22:03 +0200)
If you hit the shortcut for closing tabs over a long time
(to close all tabs), Midori hangs for some seconds.

midori/midori-browser.c

index 8df0c6cebab6b8659b9d84d64faea7bc21deb11c..3f962100ecad988b1e7d3c454b792f88b602c507 100644 (file)
@@ -2385,6 +2385,11 @@ _action_tab_close_activate (GtkAction*     action,
                             MidoriBrowser* browser)
 {
     GtkWidget* widget = midori_browser_get_current_tab (browser);
+    if (gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook), 1) == NULL &&
+        midori_view_is_blank (MIDORI_VIEW (widget)))
+    {
+        return;
+    }
     gtk_widget_destroy (widget);
 }