[mutter] xwayland: Don't fetch global when shutting down DND
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] xwayland: Don't fetch global when shutting down DND
- Date: Tue, 18 May 2021 14:31:20 +0000 (UTC)
commit 5bc8823701ebd2766a4bd77302aa48ff2e0d9899
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Apr 20 18:41:07 2021 +0200
xwayland: Don't fetch global when shutting down DND
It might not be there when shutting down, so get it from a more managed
place. Note that this isn't strictly needed right now, but eventually,
the MetaWaylandCompositor pointer will be cleared using a g_clear*()
helper, which clears the pointer before freeing the instance, which
wouldn't work here.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1863>
src/wayland/meta-xwayland-dnd.c | 5 ++---
src/wayland/meta-xwayland-private.h | 3 ++-
src/wayland/meta-xwayland.c | 9 +++++----
3 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c
index de61ccf73f..a3148ed950 100644
--- a/src/wayland/meta-xwayland-dnd.c
+++ b/src/wayland/meta-xwayland-dnd.c
@@ -976,10 +976,9 @@ meta_xwayland_init_dnd (Display *xdisplay)
}
void
-meta_xwayland_shutdown_dnd (Display *xdisplay)
+meta_xwayland_shutdown_dnd (MetaXWaylandManager *manager,
+ Display *xdisplay)
{
- MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
- MetaXWaylandManager *manager = &compositor->xwayland_manager;
MetaXWaylandDnd *dnd = manager->dnd;
g_assert (dnd != NULL);
diff --git a/src/wayland/meta-xwayland-private.h b/src/wayland/meta-xwayland-private.h
index bba0934bdf..2e38f380db 100644
--- a/src/wayland/meta-xwayland-private.h
+++ b/src/wayland/meta-xwayland-private.h
@@ -41,7 +41,8 @@ meta_xwayland_handle_xevent (XEvent *event);
/* wl_data_device/X11 selection interoperation */
void meta_xwayland_init_dnd (Display *xdisplay);
-void meta_xwayland_shutdown_dnd (Display *xdisplay);
+void meta_xwayland_shutdown_dnd (MetaXWaylandManager *manager,
+ Display *xdisplay);
gboolean meta_xwayland_dnd_handle_event (XEvent *xevent);
const MetaWaylandDragDestFuncs * meta_xwayland_selection_get_drag_dest_funcs (void);
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 325e99a927..9926f63d44 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -1208,17 +1208,18 @@ monitors_changed_cb (MetaMonitorManager *monitor_manager)
}
static void
-on_x11_display_closing (MetaDisplay *display)
+on_x11_display_closing (MetaDisplay *display,
+ MetaXWaylandManager *manager)
{
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
- meta_xwayland_shutdown_dnd (xdisplay);
+ meta_xwayland_shutdown_dnd (manager, xdisplay);
g_signal_handlers_disconnect_by_func (meta_monitor_manager_get (),
monitors_changed_cb,
NULL);
g_signal_handlers_disconnect_by_func (display,
on_x11_display_closing,
- NULL);
+ manager);
}
static void
@@ -1262,7 +1263,7 @@ meta_xwayland_complete_init (MetaDisplay *display,
#endif
g_signal_connect (display, "x11-display-closing",
- G_CALLBACK (on_x11_display_closing), NULL);
+ G_CALLBACK (on_x11_display_closing), manager);
meta_xwayland_init_dnd (xdisplay);
add_local_user_to_xhost (xdisplay);
meta_xwayland_init_xrandr (manager, xdisplay);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]