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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2124>
This commit is contained in:
Carlos Garnacho 2021-12-01 12:23:34 +01:00
parent 62ab4c09d9
commit e74e8061a4

View File

@ -34,6 +34,7 @@
#include <X11/Xatom.h>
#include <X11/extensions/Xfixes.h>
#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;
}