From e74e8061a437138c30600811c75297e273dc33df Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 1 Dec 2021 12:23:34 +0100 Subject: [PATCH] wayland: Specify workspace when looking for Xdnd drop target The meta_stack_get_default_focus_window_at_point() function started silently requiring a workspace, returning always NULL otherwise. Specify the current workspace here. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2042 Part-of: --- src/wayland/meta-xwayland-dnd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c index 2b096ef44..b3b94914d 100644 --- a/src/wayland/meta-xwayland-dnd.c +++ b/src/wayland/meta-xwayland-dnd.c @@ -34,6 +34,7 @@ #include #include +#include "core/meta-workspace-manager-private.h" #include "meta/meta-x11-errors.h" #include "wayland/meta-wayland-data-device.h" #include "wayland/meta-xwayland-private.h" @@ -635,12 +636,15 @@ pick_drop_surface (MetaWaylandCompositor *compositor, const ClutterEvent *event) { MetaDisplay *display = meta_get_display (); + MetaWorkspaceManager *workspace_manager = display->workspace_manager; + MetaWorkspace *workspace = workspace_manager->active_workspace; MetaWindow *focus_window = NULL; graphene_point_t pos; clutter_event_get_coords (event, &pos.x, &pos.y); focus_window = meta_stack_get_default_focus_window_at_point (display->stack, - NULL, NULL, + workspace, + NULL, pos.x, pos.y); return focus_window ? focus_window->surface : NULL; }