From bcdda506e1e52634ee0cd8623614e67bd1f0b8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 9 Dec 2015 10:51:54 +0800 Subject: [PATCH] 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 --- src/wayland/meta-wayland-data-device.c | 21 +-------------------- src/wayland/meta-wayland-data-device.h | 1 - src/wayland/meta-wayland-surface.c | 2 -- 3 files changed, 1 insertion(+), 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