From 6c1793b7d3adbe73976d2f67a8b3798c6cc28ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 25 Feb 2021 16:19:51 +0100 Subject: [PATCH] Rename MetaDisplayPolicy to MetaX11DisplayPolicy This lack of X11 in the name was a bit confusing, since this is about the X11 policy, not some policy of MetaDisplay. Part-of: --- src/core/display.c | 2 +- src/core/main-private.h | 14 +++++++------- src/core/main.c | 16 ++++++++-------- src/tests/clutter-test-utils.c | 2 +- src/tests/test-runner.c | 2 +- src/wayland/meta-wayland.c | 4 ++-- src/wayland/meta-xwayland.c | 14 +++++++------- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 0a50d4209..5cdfce5ee 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -890,7 +890,7 @@ meta_display_open (void) #ifdef HAVE_WAYLAND if (meta_is_wayland_compositor ()) { - if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_MANDATORY) + if (meta_get_x11_display_policy () == META_X11_DISPLAY_POLICY_MANDATORY) { meta_display_init_x11 (display, NULL, (GAsyncReadyCallback) on_x11_initialized, diff --git a/src/core/main-private.h b/src/core/main-private.h index 706520995..54d81d93e 100644 --- a/src/core/main-private.h +++ b/src/core/main-private.h @@ -30,12 +30,12 @@ typedef enum _MetaCompositorType META_COMPOSITOR_TYPE_X11, } MetaCompositorType; -typedef enum _MetaDisplayPolicy +typedef enum _MetaX11DisplayPolicy { - META_DISPLAY_POLICY_MANDATORY, - META_DISPLAY_POLICY_ON_DEMAND, - META_DISPLAY_POLICY_DISABLED, -} MetaDisplayPolicy; + META_X11_DISPLAY_POLICY_MANDATORY, + META_X11_DISPLAY_POLICY_ON_DEMAND, + META_X11_DISPLAY_POLICY_DISABLED, +} MetaX11DisplayPolicy; #define META_POINT_IN_RECT(xcoord, ycoord, rect) \ ((xcoord) >= (rect).x && \ @@ -52,9 +52,9 @@ void meta_override_compositor_configuration (MetaCompositorType compositor_type, ...); META_EXPORT_TEST -MetaDisplayPolicy meta_get_x11_display_policy (void); +MetaX11DisplayPolicy meta_get_x11_display_policy (void); META_EXPORT_TEST -void meta_override_x11_display_policy (MetaDisplayPolicy x11_display_policy); +void meta_override_x11_display_policy (MetaX11DisplayPolicy x11_display_policy); #endif /* META_MAIN_PRIVATE_H */ diff --git a/src/core/main.c b/src/core/main.c index 70efc0f8b..dae1b4e53 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -906,21 +906,21 @@ meta_get_exit_code (void) return meta_exit_code; } -static MetaDisplayPolicy x11_display_policy_override = -1; +static MetaX11DisplayPolicy x11_display_policy_override = -1; void -meta_override_x11_display_policy (MetaDisplayPolicy x11_display_policy) +meta_override_x11_display_policy (MetaX11DisplayPolicy x11_display_policy) { x11_display_policy_override = x11_display_policy; } -MetaDisplayPolicy +MetaX11DisplayPolicy meta_get_x11_display_policy (void) { MetaBackend *backend = meta_get_backend (); if (META_IS_BACKEND_X11_CM (backend)) - return META_DISPLAY_POLICY_MANDATORY; + return META_X11_DISPLAY_POLICY_MANDATORY; if (x11_display_policy_override != -1) return x11_display_policy_override; @@ -933,18 +933,18 @@ meta_get_x11_display_policy (void) #endif if (opt_no_x11) - return META_DISPLAY_POLICY_DISABLED; + return META_X11_DISPLAY_POLICY_DISABLED; #ifdef HAVE_XWAYLAND_INITFD if (sd_pid_get_user_unit (0, &unit) < 0) - return META_DISPLAY_POLICY_MANDATORY; + return META_X11_DISPLAY_POLICY_MANDATORY; else - return META_DISPLAY_POLICY_ON_DEMAND; + return META_X11_DISPLAY_POLICY_ON_DEMAND; #endif } #endif - return META_DISPLAY_POLICY_MANDATORY; + return META_X11_DISPLAY_POLICY_MANDATORY; } void diff --git a/src/tests/clutter-test-utils.c b/src/tests/clutter-test-utils.c index 4e18edbed..3bedf9bdd 100644 --- a/src/tests/clutter-test-utils.c +++ b/src/tests/clutter-test-utils.c @@ -51,7 +51,7 @@ init_common_pre (void) "aborting...\n"); meta_plugin_manager_load (test_get_plugin_name ()); - meta_override_x11_display_policy (META_DISPLAY_POLICY_DISABLED); + meta_override_x11_display_policy (META_X11_DISPLAY_POLICY_DISABLED); meta_test_init (); display = g_getenv ("DISPLAY"); diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index d85beab05..dcfdf3d15 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -77,7 +77,7 @@ test_case_new (void) TestCase *test = g_new0 (TestCase, 1); MetaDisplay *display = meta_get_display (); - if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_MANDATORY) + if (meta_get_x11_display_policy () == META_X11_DISPLAY_POLICY_MANDATORY) { test_wait_for_x11_display (); on_x11_display_opened (display, test); diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 8f16aa429..6257e76d4 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -524,7 +524,7 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *compositor) meta_wayland_eglstream_controller_init (compositor); #endif - if (meta_get_x11_display_policy () != META_DISPLAY_POLICY_DISABLED) + if (meta_get_x11_display_policy () != META_X11_DISPLAY_POLICY_DISABLED) { g_autoptr (GError) error = NULL; @@ -555,7 +555,7 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *compositor) g_message ("Using Wayland display name '%s'", compositor->display_name); - if (meta_get_x11_display_policy () != META_DISPLAY_POLICY_DISABLED) + if (meta_get_x11_display_policy () != META_X11_DISPLAY_POLICY_DISABLED) { set_gnome_env ("GNOME_SETUP_DISPLAY", compositor->xwayland_manager.private_connection.name); set_gnome_env ("DISPLAY", compositor->xwayland_manager.public_connection.name); diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index c5a9303df..325e99a92 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -549,17 +549,17 @@ xserver_died (GObject *source, } else if (!g_subprocess_get_successful (proc)) { - if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_MANDATORY) + if (meta_get_x11_display_policy () == META_X11_DISPLAY_POLICY_MANDATORY) g_warning ("X Wayland crashed; exiting"); else g_warning ("X Wayland crashed; attempting to recover"); } - if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_MANDATORY) + if (meta_get_x11_display_policy () == META_X11_DISPLAY_POLICY_MANDATORY) { meta_exit (META_EXIT_ERROR); } - else if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_ON_DEMAND) + else if (meta_get_x11_display_policy () == META_X11_DISPLAY_POLICY_ON_DEMAND) { MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); g_autoptr (GError) error = NULL; @@ -610,7 +610,7 @@ x_io_error (Display *display) { g_warning ("Connection to xwayland lost"); - if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_MANDATORY) + if (meta_get_x11_display_policy () == META_X11_DISPLAY_POLICY_MANDATORY) meta_exit (META_EXIT_ERROR); return 0; @@ -1141,7 +1141,7 @@ meta_xwayland_init (MetaXWaylandManager *manager, struct wl_display *wl_display, GError **error) { - MetaDisplayPolicy policy; + MetaX11DisplayPolicy policy; int display = 0; if (display_number_override != -1) @@ -1186,7 +1186,7 @@ meta_xwayland_init (MetaXWaylandManager *manager, manager->wayland_display = wl_display; policy = meta_get_x11_display_policy (); - if (policy == META_DISPLAY_POLICY_ON_DEMAND) + if (policy == META_X11_DISPLAY_POLICY_ON_DEMAND) { manager->abstract_fd_watch_id = g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN, @@ -1267,7 +1267,7 @@ meta_xwayland_complete_init (MetaDisplay *display, add_local_user_to_xhost (xdisplay); meta_xwayland_init_xrandr (manager, xdisplay); - if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_ON_DEMAND) + if (meta_get_x11_display_policy () == META_X11_DISPLAY_POLICY_ON_DEMAND) { meta_xwayland_stop_xserver_timeout (manager); g_signal_connect (meta_get_display (), "window-created",