summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-data-device.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-10-06 17:07:43 +0200
committerJasper St. Pierre <jstpierre@mecheye.net>2014-10-06 19:39:43 -0700
commit9c589b6798e8d351f3370f720e0321c6f09315ff (patch)
treef64b9a3024f7a84020693af20202599187609bfc /src/wayland/meta-wayland-data-device.c
parent113be01ce800a33eb5bfa6bd51f00eea5e99f27c (diff)
downloadmutter-9c589b6798e8d351f3370f720e0321c6f09315ff.tar.gz
wayland: Ensure drag surface offset changes update the DnD actor
Diffstat (limited to 'src/wayland/meta-wayland-data-device.c')
-rw-r--r--src/wayland/meta-wayland-data-device.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 967bda2d7..a726cd279 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -643,3 +643,29 @@ meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device)
wl_data_device_send_selection (data_device_resource, offer);
}
}
+
+gboolean
+meta_wayland_data_device_is_dnd_surface (MetaWaylandDataDevice *data_device,
+ MetaWaylandSurface *surface)
+{
+ return data_device->current_grab &&
+ data_device->current_grab->drag_surface == surface;
+}
+
+void
+meta_wayland_data_device_update_dnd_surface (MetaWaylandDataDevice *data_device)
+{
+ MetaWaylandDragGrab *drag_grab;
+
+ if (!data_device->current_grab)
+ return;
+
+ drag_grab = data_device->current_grab;
+
+ if (!drag_grab->feedback_actor || !drag_grab->drag_surface)
+ return;
+
+ meta_feedback_actor_set_anchor (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
+ -drag_grab->drag_surface->offset_x,
+ -drag_grab->drag_surface->offset_y);
+}