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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1833>
This commit is contained in:
parent
f677e0cbfb
commit
6c1793b7d3
@ -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,
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user