xwayland: Only warn on X IO errors when X11 is mandatory

This avoids warnings when we're just slightly unlucky when Xwayland went
away due to inactivity.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2364>
This commit is contained in:
Jonas Ådahl 2022-04-05 23:45:51 +02:00 committed by Marge Bot
parent e1033951ef
commit bdb34401c5
2 changed files with 13 additions and 1 deletions

View File

@ -54,6 +54,8 @@ typedef struct
struct _MetaXWaylandManager
{
MetaWaylandCompositor *compositor;
MetaXWaylandConnection private_connection;
MetaXWaylandConnection public_connection;

View File

@ -478,7 +478,16 @@ static void
x_io_error_exit (Display *display,
void *data)
{
g_warning ("Xwayland just died, attempting to recover");
MetaXWaylandManager *manager = data;
MetaX11DisplayPolicy x11_display_policy;
x11_display_policy =
meta_context_get_x11_display_policy (manager->compositor->context);
if (x11_display_policy == META_X11_DISPLAY_POLICY_MANDATORY)
g_warning ("X Wayland crashed (X IO error)");
else
meta_topic (META_DEBUG_WAYLAND, "Xwayland disappeared");
}
static void
@ -1033,6 +1042,7 @@ meta_xwayland_init (MetaXWaylandManager *manager,
manager->public_connection.name,
manager->private_connection.name);
manager->compositor = compositor;
manager->wayland_display = wl_display;
policy = meta_context_get_x11_display_policy (context);