[gnome-builder] grep: Don't activate button when pressing Enter in entry if insensitive



commit aaeb9bfab784aea1770cf9d71334b335f0232edb
Author: vanadiae <vanadiae35 gmail com>
Date:   Fri Aug 6 18:11:14 2021 +0200

    grep: Don't activate button when pressing Enter in entry if insensitive
    
    I expected the activate signal to be guarded by this check, but it seems
    it isn't.

 src/plugins/grep/gbp-grep-panel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/grep/gbp-grep-panel.c b/src/plugins/grep/gbp-grep-panel.c
index dcbeef422..e2839f0a8 100644
--- a/src/plugins/grep/gbp-grep-panel.c
+++ b/src/plugins/grep/gbp-grep-panel.c
@@ -515,7 +515,8 @@ on_entry_activate_toggle_action_button_cb (GtkEntry *entry,
   g_assert (GTK_IS_ENTRY (entry));
   g_assert (GTK_IS_BUTTON (button));
 
-  g_signal_emit_by_name (button, "activate", NULL);
+  if (gtk_widget_get_sensitive (GTK_WIDGET (button)))
+    g_signal_emit_by_name (button, "activate", NULL);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]