1
0
Fork 0

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
This commit is contained in:
Olivier Fourdan 2020-08-04 08:59:54 +02:00
parent 5ed97f3a02
commit 17417a82a5
5 changed files with 31 additions and 30 deletions

View file

@ -75,7 +75,7 @@
For a X11 grab to be taken into account under Wayland, the client must 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 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> </description>
</key> </key>
@ -91,8 +91,9 @@
Wildcards “*” and jokers “?” in the values are supported. Wildcards “*” and jokers “?” in the values are supported.
Values starting with “!” are blacklisted, which has precedence over Values starting with “!” are denied, which has precedence over
the whitelist, to revoke applications from the default system list. the list of values allowed, to revoke applications from the default
system list.
The default system list includes the following applications: The default system list includes the following applications:

View file

@ -64,8 +64,8 @@ void meta_settings_enable_experimental_feature (MetaSettings *settings
MetaExperimentalFeature feature); MetaExperimentalFeature feature);
void meta_settings_get_xwayland_grab_patterns (MetaSettings *settings, void meta_settings_get_xwayland_grab_patterns (MetaSettings *settings,
GPtrArray **whitelist_patterns, GPtrArray **allow_list_patterns,
GPtrArray **blacklist_patterns); GPtrArray **deny_list_patterns);
gboolean meta_settings_are_xwayland_grabs_allowed (MetaSettings *settings); gboolean meta_settings_are_xwayland_grabs_allowed (MetaSettings *settings);

View file

@ -66,8 +66,8 @@ struct _MetaSettings
gboolean experimental_features_overridden; gboolean experimental_features_overridden;
gboolean xwayland_allow_grabs; gboolean xwayland_allow_grabs;
GPtrArray *xwayland_grab_whitelist_patterns; GPtrArray *xwayland_grab_allow_list_patterns;
GPtrArray *xwayland_grab_blacklist_patterns; GPtrArray *xwayland_grab_deny_list_patterns;
}; };
G_DEFINE_TYPE (MetaSettings, meta_settings, G_TYPE_OBJECT) G_DEFINE_TYPE (MetaSettings, meta_settings, G_TYPE_OBJECT)
@ -321,12 +321,12 @@ static void
xwayland_grab_list_add_item (MetaSettings *settings, xwayland_grab_list_add_item (MetaSettings *settings,
char *item) char *item)
{ {
/* If first character is '!', it's a blacklisted item */ /* If first character is '!', it's a denied value */
if (item[0] != '!') 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)); g_pattern_spec_new (item));
else if (item[1] != 0) 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])); g_pattern_spec_new (&item[1]));
} }
@ -356,14 +356,14 @@ update_xwayland_grab_access_rules (MetaSettings *settings)
int i; int i;
/* Free previous patterns and create new arrays */ /* 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); 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_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); 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); g_ptr_array_new_with_free_func ((GDestroyNotify) g_pattern_spec_free);
/* Add system defaults values */ /* Add system defaults values */
@ -405,11 +405,11 @@ wayland_settings_changed (GSettings *wayland_settings,
void void
meta_settings_get_xwayland_grab_patterns (MetaSettings *settings, meta_settings_get_xwayland_grab_patterns (MetaSettings *settings,
GPtrArray **whitelist_patterns, GPtrArray **allow_list_patterns,
GPtrArray **blacklist_patterns) GPtrArray **deny_list_patterns)
{ {
*whitelist_patterns = settings->xwayland_grab_whitelist_patterns; *allow_list_patterns = settings->xwayland_grab_allow_list_patterns;
*blacklist_patterns = settings->xwayland_grab_blacklist_patterns; *deny_list_patterns = settings->xwayland_grab_deny_list_patterns;
} }
gboolean gboolean
@ -437,9 +437,9 @@ meta_settings_dispose (GObject *object)
g_clear_object (&settings->mutter_settings); g_clear_object (&settings->mutter_settings);
g_clear_object (&settings->interface_settings); g_clear_object (&settings->interface_settings);
g_clear_object (&settings->wayland_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_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_ptr_array_unref);
G_OBJECT_CLASS (meta_settings_parent_class)->dispose (object); G_OBJECT_CLASS (meta_settings_parent_class)->dispose (object);

View file

@ -48,7 +48,7 @@ struct _MetaPlayRequest
MetaSoundPlayer *player; MetaSoundPlayer *player;
}; };
const char * const cache_whitelist[] = { const char * const cache_allow_list[] = {
"bell-window-system", "bell-window-system",
"desktop-switch-left", "desktop-switch-left",
"desktop-switch-right", "desktop-switch-right",
@ -251,7 +251,7 @@ meta_sound_player_play_from_theme (MetaSoundPlayer *player,
ca_proplist_create (&props); ca_proplist_create (&props);
build_ca_proplist (props, CA_PROP_EVENT_ID, name, description); 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"); ca_proplist_sets (props, CA_PROP_CANBERRA_CACHE_CONTROL, "permanent");
else else
ca_proplist_sets (props, CA_PROP_CANBERRA_CACHE_CONTROL, "volatile"); ca_proplist_sets (props, CA_PROP_CANBERRA_CACHE_CONTROL, "volatile");

View file

@ -183,26 +183,26 @@ meta_xwayland_grab_is_granted (MetaWindow *window)
{ {
MetaBackend *backend; MetaBackend *backend;
MetaSettings *settings; MetaSettings *settings;
GPtrArray *whitelist; GPtrArray *allow_list;
GPtrArray *blacklist; GPtrArray *deny_list;
gboolean may_grab; gboolean may_grab;
backend = meta_get_backend (); backend = meta_get_backend ();
settings = meta_backend_get_settings (backend); settings = meta_backend_get_settings (backend);
/* Check whether the window is blacklisted */ /* Check whether the window is in the deny list */
meta_settings_get_xwayland_grab_patterns (settings, &whitelist, &blacklist); 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; 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); g_object_get (G_OBJECT (window), "xwayland-may-grab-keyboard", &may_grab, NULL);
if (may_grab) if (may_grab)
return TRUE; return TRUE;
/* Last resort, is it white listed. */ /* Last resort, is it in the grant list. */
if (whitelist && application_is_in_pattern_array (window, whitelist)) if (allow_list && application_is_in_pattern_array (window, allow_list))
return TRUE; return TRUE;
return FALSE; return FALSE;