From 20a34d0ae708bc777e39bf396174d358c63a3742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Thu, 28 May 2009 23:01:56 +0200 Subject: [PATCH] Treat select-all specially with text views and tree views 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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 109e8800..5cc4c829 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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"); + } } }