modelbutton: Remove accel poking
authorMatthias Clasen <mclasen@redhat.com>
Mon, 23 Mar 2020 18:46:20 +0000 (14:46 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 26 Mar 2020 03:14:45 +0000 (23:14 -0400)
Stop manually poking GtkApplication for accels.
GtkApplication already feeds them into the action
muxer machinery, so that is where will get them.

gtk/gtkmodelbutton.c

index 49b69b28e85edeeca055a00ea4e4429e645c702f..54b1bf34b8dc51c596047762a19214303795f9ea 100644 (file)
@@ -980,48 +980,6 @@ gtk_model_button_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_model_button_parent_class)->finalize (object);
 }
 
-static void
-gtk_model_button_root (GtkWidget *widget)
-{
-  GtkModelButton *self = GTK_MODEL_BUTTON (widget);
-  GtkRoot *root;
-  GtkApplication *app;
-  const char *action_name;
-  GVariant *action_target;
-
-  GTK_WIDGET_CLASS (gtk_model_button_parent_class)->root (widget);
-
-  if (!self->accel)
-    return;
-
-  root = gtk_widget_get_root (widget);
-
-  if (!GTK_IS_WINDOW (root))
-    return;
-
-  app = gtk_window_get_application (GTK_WINDOW (root));
-
-  if (!app)
-    return;
-
-  action_name = gtk_actionable_get_action_name (GTK_ACTIONABLE (widget));
-  action_target = gtk_actionable_get_action_target_value (GTK_ACTIONABLE (widget));
-
-  if (action_name)
-    {
-      char *detailed;
-      char **accels;
-
-      detailed = g_action_print_detailed_name (action_name, action_target);
-      accels = gtk_application_get_accels_for_action (app, detailed);
-
-      update_accel (self, accels[0]);
-
-      g_strfreev (accels);
-      g_free (detailed);
-    }
-}
-
 static gboolean
 gtk_model_button_focus (GtkWidget        *widget,
                         GtkDirectionType  direction)
@@ -1094,7 +1052,6 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
   widget_class->state_flags_changed = gtk_model_button_state_flags_changed;
   widget_class->direction_changed = gtk_model_button_direction_changed;
   widget_class->focus = gtk_model_button_focus;
-  widget_class->root = gtk_model_button_root;
   widget_class->get_accessible = gtk_model_button_get_accessible;
 
   /**