[mutter] xwayland: Pass the manager object to XSetIOErrorExitHandler



commit 69f9b366435c713af122a634f4293b493d78db0c
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Mar 23 16:43:52 2021 +0100

    xwayland: Pass the manager object to XSetIOErrorExitHandler
    
    This means we can avoid going through global singletons in the handler.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1796>

 src/wayland/meta-xwayland.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index ff5150d014..8789cbdd84 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -635,8 +635,7 @@ static void
 x_io_error_exit (Display *display,
                  void    *data)
 {
-  MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
-  MetaXWaylandManager *manager = &compositor->xwayland_manager;
+  MetaXWaylandManager *manager = data;
 
   g_warning ("Xwayland just died, attempting to recover");
   manager->xserver_grace_period_id =
@@ -1271,7 +1270,7 @@ meta_xwayland_complete_init (MetaDisplay *display,
   */
   XSetIOErrorHandler (x_io_error);
 #ifdef HAVE_XSETIOERROREXITHANDLER
-  XSetIOErrorExitHandler (xdisplay, x_io_error_exit, display);
+  XSetIOErrorExitHandler (xdisplay, x_io_error_exit, manager);
 #endif
 
   g_signal_connect (display, "x11-display-closing",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]