[mutter] MetaWaylandDataDevice: Don't set surface offset as anchor offset
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] MetaWaylandDataDevice: Don't set surface offset as anchor offset
- Date: Tue, 19 Jan 2016 13:33:08 +0000 (UTC)
commit bcdda506e1e52634ee0cd8623614e67bd1f0b8da
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Dec 9 10:51:54 2015 +0800
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 insertions(+), 23 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 101db78..d5b4c06 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 67057fd..cdb4f05 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 fe89b5b..f9b3f3c 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]