[gnome-text-editor] view: avoid changing action-enabled state



commit a4c29abcff80963072545dbb98f0a5103d0a4185
Author: Christian Hergert <chergert redhat com>
Date:   Fri Nov 12 13:52:44 2021 -0800

    view: avoid changing action-enabled state
    
    We don't want to change this because it causes extra action muxer work.
    
    Related #220

 src/editor-source-view.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/editor-source-view.c b/src/editor-source-view.c
index 0880ed8..be29539 100644
--- a/src/editor-source-view.c
+++ b/src/editor-source-view.c
@@ -216,9 +216,6 @@ on_click_pressed_cb (GtkGestureClick  *click,
 cleanup:
   g_free (self->spelling_word);
   self->spelling_word = g_steal_pointer (&word);
-  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.add", self->spelling_word != NULL);
-  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.ignore", self->spelling_word != NULL);
-  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.correct", self->spelling_word != NULL);
   editor_spell_menu_set_corrections (self->spelling_menu,
                                      (const char * const *)corrections);
 }
@@ -528,9 +525,10 @@ editor_source_view_init (EditorSourceView *self)
   GtkStyleContext *style_context;
   GMenuModel *extra_menu;
 
-  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.add", FALSE);
-  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.ignore", FALSE);
-  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.correct", FALSE);
+  /* Always keep these true to avoid actionmuxer changes */
+  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.add", TRUE);
+  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.ignore", TRUE);
+  gtk_widget_action_set_enabled (GTK_WIDGET (self), "spelling.correct", TRUE);
 
   self->css_provider = gtk_css_provider_new ();
   style_context = gtk_widget_get_style_context (GTK_WIDGET (self));


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