[mutter] cleanup: remove controversial naming



commit 17417a82a5e2a9086ebbbc6bd5b2556729861e80
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Tue Aug 4 08:59:54 2020 +0200

    cleanup: remove controversial naming
    
    Replace "whitelist" and "blacklist" with "allow_list" and "deny_list"
    which better represent the purpose of those variables.
    
    There is no functional change.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1396

 data/org.gnome.mutter.wayland.gschema.xml.in |  7 ++++---
 src/backends/meta-settings-private.h         |  4 ++--
 src/backends/meta-settings.c                 | 30 ++++++++++++++--------------
 src/core/meta-sound-player.c                 |  4 ++--
 src/wayland/meta-xwayland-grab-keyboard.c    | 16 +++++++--------
 5 files changed, 31 insertions(+), 30 deletions(-)
---
diff --git a/data/org.gnome.mutter.wayland.gschema.xml.in b/data/org.gnome.mutter.wayland.gschema.xml.in
index bd41e9f186..23ce8386c6 100644
--- a/data/org.gnome.mutter.wayland.gschema.xml.in
+++ b/data/org.gnome.mutter.wayland.gschema.xml.in
@@ -75,7 +75,7 @@
 
         For a X11 grab to be taken into account under Wayland, the client must
         also either send a specific X11 ClientMessage to the root window or be
-        among the applications white-listed in key “xwayland-grab-access-rules”.
+        among the applications allowed in key “xwayland-grab-access-rules”.
       </description>
     </key>
 
@@ -91,8 +91,9 @@
 
         Wildcards “*” and jokers “?” in the values are supported.
 
-        Values starting with “!” are blacklisted, which has precedence over
-        the whitelist, to revoke applications from the default system list.
+        Values starting with “!” are denied, which has precedence over
+        the list of values allowed, to revoke applications from the default
+       system list.
 
         The default system list includes the following applications:
 
diff --git a/src/backends/meta-settings-private.h b/src/backends/meta-settings-private.h
index 7d610d5b4d..5e5d8e8dd8 100644
--- a/src/backends/meta-settings-private.h
+++ b/src/backends/meta-settings-private.h
@@ -64,8 +64,8 @@ void meta_settings_enable_experimental_feature (MetaSettings           *settings
                                                 MetaExperimentalFeature feature);
 
 void meta_settings_get_xwayland_grab_patterns (MetaSettings  *settings,
-                                               GPtrArray    **whitelist_patterns,
-                                               GPtrArray    **blacklist_patterns);
+                                               GPtrArray    **allow_list_patterns,
+                                               GPtrArray    **deny_list_patterns);
 
 gboolean meta_settings_are_xwayland_grabs_allowed (MetaSettings *settings);
 
diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c
index 1cc000e614..14a9ead225 100644
--- a/src/backends/meta-settings.c
+++ b/src/backends/meta-settings.c
@@ -66,8 +66,8 @@ struct _MetaSettings
   gboolean experimental_features_overridden;
 
   gboolean xwayland_allow_grabs;
-  GPtrArray *xwayland_grab_whitelist_patterns;
-  GPtrArray *xwayland_grab_blacklist_patterns;
+  GPtrArray *xwayland_grab_allow_list_patterns;
+  GPtrArray *xwayland_grab_deny_list_patterns;
 };
 
 G_DEFINE_TYPE (MetaSettings, meta_settings, G_TYPE_OBJECT)
@@ -321,12 +321,12 @@ static void
 xwayland_grab_list_add_item (MetaSettings *settings,
                              char         *item)
 {
-  /* If first character is '!', it's a blacklisted item */
+  /* If first character is '!', it's a denied value */
   if (item[0] != '!')
-    g_ptr_array_add (settings->xwayland_grab_whitelist_patterns,
+    g_ptr_array_add (settings->xwayland_grab_allow_list_patterns,
                      g_pattern_spec_new (item));
   else if (item[1] != 0)
-    g_ptr_array_add (settings->xwayland_grab_blacklist_patterns,
+    g_ptr_array_add (settings->xwayland_grab_deny_list_patterns,
                      g_pattern_spec_new (&item[1]));
 }
 
@@ -356,14 +356,14 @@ update_xwayland_grab_access_rules (MetaSettings *settings)
   int i;
 
   /* Free previous patterns and create new arrays */
-  g_clear_pointer (&settings->xwayland_grab_whitelist_patterns,
+  g_clear_pointer (&settings->xwayland_grab_allow_list_patterns,
                    g_ptr_array_unref);
-  settings->xwayland_grab_whitelist_patterns =
+  settings->xwayland_grab_allow_list_patterns =
     g_ptr_array_new_with_free_func ((GDestroyNotify) g_pattern_spec_free);
 
-  g_clear_pointer (&settings->xwayland_grab_blacklist_patterns,
+  g_clear_pointer (&settings->xwayland_grab_deny_list_patterns,
                    g_ptr_array_unref);
-  settings->xwayland_grab_blacklist_patterns =
+  settings->xwayland_grab_deny_list_patterns =
     g_ptr_array_new_with_free_func ((GDestroyNotify) g_pattern_spec_free);
 
   /* Add system defaults values */
@@ -405,11 +405,11 @@ wayland_settings_changed (GSettings    *wayland_settings,
 
 void
 meta_settings_get_xwayland_grab_patterns (MetaSettings  *settings,
-                                          GPtrArray    **whitelist_patterns,
-                                          GPtrArray    **blacklist_patterns)
+                                          GPtrArray    **allow_list_patterns,
+                                          GPtrArray    **deny_list_patterns)
 {
-  *whitelist_patterns = settings->xwayland_grab_whitelist_patterns;
-  *blacklist_patterns = settings->xwayland_grab_blacklist_patterns;
+  *allow_list_patterns = settings->xwayland_grab_allow_list_patterns;
+  *deny_list_patterns = settings->xwayland_grab_deny_list_patterns;
 }
 
 gboolean
@@ -437,9 +437,9 @@ meta_settings_dispose (GObject *object)
   g_clear_object (&settings->mutter_settings);
   g_clear_object (&settings->interface_settings);
   g_clear_object (&settings->wayland_settings);
-  g_clear_pointer (&settings->xwayland_grab_whitelist_patterns,
+  g_clear_pointer (&settings->xwayland_grab_allow_list_patterns,
                    g_ptr_array_unref);
-  g_clear_pointer (&settings->xwayland_grab_blacklist_patterns,
+  g_clear_pointer (&settings->xwayland_grab_deny_list_patterns,
                    g_ptr_array_unref);
 
   G_OBJECT_CLASS (meta_settings_parent_class)->dispose (object);
diff --git a/src/core/meta-sound-player.c b/src/core/meta-sound-player.c
index 00f110f75e..e2d1038933 100644
--- a/src/core/meta-sound-player.c
+++ b/src/core/meta-sound-player.c
@@ -48,7 +48,7 @@ struct _MetaPlayRequest
   MetaSoundPlayer *player;
 };
 
-const char * const cache_whitelist[] = {
+const char * const cache_allow_list[] = {
   "bell-window-system",
   "desktop-switch-left",
   "desktop-switch-right",
@@ -251,7 +251,7 @@ meta_sound_player_play_from_theme (MetaSoundPlayer *player,
   ca_proplist_create (&props);
   build_ca_proplist (props, CA_PROP_EVENT_ID, name, description);
 
-  if (g_strv_contains (cache_whitelist, name))
+  if (g_strv_contains (cache_allow_list, name))
     ca_proplist_sets (props, CA_PROP_CANBERRA_CACHE_CONTROL, "permanent");
   else
     ca_proplist_sets (props, CA_PROP_CANBERRA_CACHE_CONTROL, "volatile");
diff --git a/src/wayland/meta-xwayland-grab-keyboard.c b/src/wayland/meta-xwayland-grab-keyboard.c
index c9eeca8d00..4cb8c58a8f 100644
--- a/src/wayland/meta-xwayland-grab-keyboard.c
+++ b/src/wayland/meta-xwayland-grab-keyboard.c
@@ -183,26 +183,26 @@ meta_xwayland_grab_is_granted (MetaWindow *window)
 {
   MetaBackend *backend;
   MetaSettings *settings;
-  GPtrArray *whitelist;
-  GPtrArray *blacklist;
+  GPtrArray *allow_list;
+  GPtrArray *deny_list;
   gboolean may_grab;
 
   backend = meta_get_backend ();
   settings = meta_backend_get_settings (backend);
 
-  /* Check whether the window is blacklisted */
-  meta_settings_get_xwayland_grab_patterns (settings, &whitelist, &blacklist);
+  /* Check whether the window is in the deny list */
+  meta_settings_get_xwayland_grab_patterns (settings, &allow_list, &deny_list);
 
-  if (blacklist && application_is_in_pattern_array (window, blacklist))
+  if (deny_list && application_is_in_pattern_array (window, deny_list))
     return FALSE;
 
-  /* Check if we are dealing with good citizen Xwayland client whitelisting itself. */
+  /* Check if we are dealing with good citizen Xwayland client allowing itself. */
   g_object_get (G_OBJECT (window), "xwayland-may-grab-keyboard", &may_grab, NULL);
   if (may_grab)
     return TRUE;
 
-  /* Last resort, is it white listed. */
-  if (whitelist && application_is_in_pattern_array (window, whitelist))
+  /* Last resort, is it in the grant list. */
+  if (allow_list && application_is_in_pattern_array (window, allow_list))
     return TRUE;
 
   return FALSE;


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