summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2015-12-09 10:51:54 +0800
committerCarlos Garnacho <carlosg@gnome.org>2016-01-19 14:32:34 +0100
commitbcdda506e1e52634ee0cd8623614e67bd1f0b8da (patch)
treeb3057bcf939d629bda67bec281ee02f818f51dcf
parent9b26694bbca5145d01abb66c0ac5d85f70047875 (diff)
downloadmutter-bcdda506e1e52634ee0cd8623614e67bd1f0b8da.tar.gz
MetaWaylandDataDevice: Don't set surface offset as anchor offset
Since we are using the surface actor to draw the DND icon, the offset is already accounted for by MetaSurfaceActorWayland, and passing the surface position offset would effectively double the actual offset, causing the icon to be misplaced. This patch always sets the anchor offset to (0, 0) when the icon is a Wayland surface, and lets the surface actor deal with the offsetting. https://bugzilla.gnome.org/show_bug.cgi?id=759222
-rw-r--r--src/wayland/meta-wayland-data-device.c21
-rw-r--r--src/wayland/meta-wayland-data-device.h1
-rw-r--r--src/wayland/meta-wayland-surface.c2
3 files changed, 1 insertions, 23 deletions
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 101db78d1..d5b4c062c 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -915,8 +915,7 @@ meta_wayland_data_device_start_drag (MetaWaylandDataDevice *data
drag_grab->drag_start_x,
drag_grab->drag_start_y);
meta_feedback_actor_set_anchor (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
- -drag_grab->drag_surface->offset_x,
- -drag_grab->drag_surface->offset_y);
+ 0, 0);
clutter_actor_add_child (drag_grab->feedback_actor,
CLUTTER_ACTOR (drag_grab->drag_surface->surface_actor));
@@ -1457,24 +1456,6 @@ meta_wayland_data_device_is_dnd_surface (MetaWaylandDataDevice *data_device,
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);
-}
-
gboolean
meta_wayland_data_source_has_mime_type (const MetaWaylandDataSource *source,
const gchar *mime_type)
diff --git a/src/wayland/meta-wayland-data-device.h b/src/wayland/meta-wayland-data-device.h
index 67057fd25..cdb4f05d7 100644
--- a/src/wayland/meta-wayland-data-device.h
+++ b/src/wayland/meta-wayland-data-device.h
@@ -74,7 +74,6 @@ void meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_de
gboolean meta_wayland_data_device_is_dnd_surface (MetaWaylandDataDevice *data_device,
MetaWaylandSurface *surface);
-void meta_wayland_data_device_update_dnd_surface (MetaWaylandDataDevice *data_device);
void meta_wayland_data_device_set_dnd_source (MetaWaylandDataDevice *data_device,
MetaWaylandDataSource *source);
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index fe89b5bc3..f9b3f3c07 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -257,8 +257,6 @@ dnd_surface_commit (MetaWaylandSurfaceRole *surface_role,
meta_wayland_surface_role_get_surface (surface_role);
meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending);
-
- meta_wayland_data_device_update_dnd_surface (&surface->compositor->seat->data_device);
}
static void