[libdazzle] gtk: work around recent gtk changes in action muxing



commit 85e1fd771de48ed1e4bccd84792d772d00a7bf14
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 2 16:50:47 2019 -0700

    gtk: work around recent gtk changes in action muxing
    
    We need to be more careful about changing/removing actions when updating
    the muxer entries. This tries to only remove items that were not matched
    so that we don't risk losing access to the items in the mean time.

 src/util/dzl-gtk.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/util/dzl-gtk.c b/src/util/dzl-gtk.c
index 95ac321..f53d829 100644
--- a/src/util/dzl-gtk.c
+++ b/src/util/dzl-gtk.c
@@ -426,17 +426,6 @@ dzl_gtk_widget_mux_action_groups (GtkWidget   *widget,
 
   old_prefixes = g_object_get_data (G_OBJECT (widget), mux_key);
 
-  if (old_prefixes != NULL)
-    {
-      for (guint i = 0; old_prefixes [i]; i++)
-        {
-          if (g_str_equal (old_prefixes [i], "win") || g_str_equal (old_prefixes [i], "app"))
-            continue;
-
-          gtk_widget_insert_action_group (widget, old_prefixes [i], NULL);
-        }
-    }
-
   /*
    * Now, if there is a from_widget to mux, get all of their action
    * groups and mux them across to our target widget.
@@ -463,6 +452,17 @@ dzl_gtk_widget_mux_action_groups (GtkWidget   *widget,
               gtk_widget_insert_action_group (widget, prefixes[i], group);
             }
         }
+
+      if (old_prefixes != NULL && prefixes != NULL)
+        {
+          for (guint i = 0; old_prefixes[i]; i++)
+            {
+              gboolean found = g_strv_contains ((const gchar * const *)prefixes, old_prefixes[i]);
+
+              if (!found)
+                gtk_widget_insert_action_group (widget, old_prefixes[i], NULL);
+            }
+        }
     }
 
   /* Store the set of muxed prefixes so that we can unmux them later. */


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