diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c index a3148ed95..2b096ef44 100644 --- a/src/wayland/meta-xwayland-dnd.c +++ b/src/wayland/meta-xwayland-dnd.c @@ -942,10 +942,11 @@ meta_xwayland_dnd_handle_event (XEvent *xevent) } void -meta_xwayland_init_dnd (Display *xdisplay) +meta_xwayland_init_dnd (MetaX11Display *x11_display) { MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); MetaXWaylandManager *manager = &compositor->xwayland_manager; + Display *xdisplay = meta_x11_display_get_xdisplay (x11_display); MetaXWaylandDnd *dnd = manager->dnd; XSetWindowAttributes attributes; guint32 i, version = XDND_VERSION; @@ -961,7 +962,7 @@ meta_xwayland_init_dnd (Display *xdisplay) attributes.override_redirect = True; dnd->dnd_window = XCreateWindow (xdisplay, - gdk_x11_window_get_xid (gdk_get_default_root_window ()), + meta_x11_display_get_xroot (x11_display), -1, -1, 1, 1, 0, /* border width */ 0, /* depth */ @@ -977,13 +978,13 @@ meta_xwayland_init_dnd (Display *xdisplay) void meta_xwayland_shutdown_dnd (MetaXWaylandManager *manager, - Display *xdisplay) + MetaX11Display *x11_display) { MetaXWaylandDnd *dnd = manager->dnd; g_assert (dnd != NULL); - XDestroyWindow (xdisplay, dnd->dnd_window); + XDestroyWindow (meta_x11_display_get_xdisplay (x11_display), dnd->dnd_window); dnd->dnd_window = None; g_free (dnd); diff --git a/src/wayland/meta-xwayland-private.h b/src/wayland/meta-xwayland-private.h index 1efa94815..90f36497c 100644 --- a/src/wayland/meta-xwayland-private.h +++ b/src/wayland/meta-xwayland-private.h @@ -45,9 +45,9 @@ gboolean meta_xwayland_handle_xevent (XEvent *event); /* wl_data_device/X11 selection interoperation */ -void meta_xwayland_init_dnd (Display *xdisplay); +void meta_xwayland_init_dnd (MetaX11Display *x11_display); void meta_xwayland_shutdown_dnd (MetaXWaylandManager *manager, - Display *xdisplay); + MetaX11Display *x11_display); 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 84db7bc66..c0dbe7b09 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -1218,9 +1218,9 @@ static void on_x11_display_closing (MetaDisplay *display, MetaXWaylandManager *manager) { - Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display); + MetaX11Display *x11_display = meta_display_get_x11_display (display); - meta_xwayland_shutdown_dnd (manager, xdisplay); + meta_xwayland_shutdown_dnd (manager, x11_display); g_signal_handlers_disconnect_by_func (meta_monitor_manager_get (), monitors_changed_cb, NULL); @@ -1263,7 +1263,7 @@ on_x11_display_setup (MetaDisplay *display, Display *xdisplay = meta_x11_display_get_xdisplay (x11_display); MetaX11DisplayPolicy x11_display_policy; - meta_xwayland_init_dnd (xdisplay); + meta_xwayland_init_dnd (x11_display); meta_xwayland_init_xrandr (manager, xdisplay); meta_xwayland_stop_xserver_timeout (manager);