]> spindle.queued.net Git - midori/commitdiff
Treat select-all specially with text views and tree views
authorEnrico Tröger <enrico.troeger@uvena.de>
Thu, 28 May 2009 21:01:56 +0000 (23:01 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 28 May 2009 21:01:56 +0000 (23:01 +0200)
Unfortunately select-all signals within Gtk have different
semantics against intuition, so we have to treat text views
and tree views specially to avoid crashing.

midori/midori-browser.c

index 109e88005c31cf38710c0206bf5592b5308511a0..5cc4c8297ffee91113627a02cbb4a9a2330e36b1 100644 (file)
@@ -2021,7 +2021,17 @@ _action_select_all_activate (GtkAction*     action,
         if (GTK_IS_EDITABLE (widget))
             gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
         else if (g_signal_lookup ("select-all", G_OBJECT_TYPE (widget)))
-            g_signal_emit_by_name (widget, "select-all", TRUE);
+        {
+            if (GTK_IS_TEXT_VIEW (widget))
+                g_signal_emit_by_name (widget, "select-all", TRUE);
+            else if (GTK_IS_TREE_VIEW (widget))
+            {
+                gboolean dummy;
+                g_signal_emit_by_name (widget, "select-all", &dummy);
+            }
+            else
+                g_signal_emit_by_name (widget, "select-all");
+        }
     }
 }