[mutter/wip/carlosg/on-demand-fixes: 2/3] wayland: Start up the grace Xwayland period right after starting Xwayland
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/on-demand-fixes: 2/3] wayland: Start up the grace Xwayland period right after starting Xwayland
- Date: Thu, 15 Aug 2019 12:59:27 +0000 (UTC)
commit 9b4e5ded6ae6edc63e69e1cb3d8ea15e9f431f13
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 13 20:56:32 2019 +0200
wayland: Start up the grace Xwayland period right after starting Xwayland
There may be cases where a X11 client does not spawn any X11 windows (eg.
simple clients like xlsclients), in this case the Xwayland server would
remain running until X11 windows happen to come and go.
src/wayland/meta-xwayland.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index fec8662cc..a25e645bb 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -683,6 +683,16 @@ xdisplay_connection_activity_cb (gint fd,
return G_SOURCE_REMOVE;
}
+static void
+meta_xwayland_stop_xserver_timeout (MetaXWaylandManager *manager)
+{
+ if (manager->xserver_grace_period_id)
+ return;
+
+ manager->xserver_grace_period_id =
+ g_timeout_add_seconds (10, shutdown_xwayland_cb, manager);
+}
+
static void
window_unmanaged_cb (MetaWindow *window,
MetaXWaylandManager *manager)
@@ -694,8 +704,7 @@ window_unmanaged_cb (MetaWindow *window,
if (!manager->x11_windows)
{
meta_verbose ("All X11 windows gone, setting shutdown timeout");
- manager->xserver_grace_period_id =
- g_timeout_add_seconds (10, shutdown_xwayland_cb, manager);
+ meta_xwayland_stop_xserver_timeout (manager);
}
}
@@ -799,6 +808,7 @@ meta_xwayland_complete_init (MetaDisplay *display)
if (meta_get_x11_display_policy () == META_DISPLAY_POLICY_ON_DEMAND)
{
+ meta_xwayland_stop_xserver_timeout (manager);
g_signal_connect (meta_get_display (), "window-created",
G_CALLBACK (window_created_cb), manager);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]