[mutter/wip/dnd-surface2: 1/18] wayland: Record the offset position
- From: Carlos Garnacho <carlosg src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [mutter/wip/dnd-surface2: 1/18] wayland: Record the offset position
 
- Date: Tue, 30 Sep 2014 15:35:13 +0000 (UTC)
 
commit 92b7daab61886447f37bf850fb62114b1d1fcd70
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Aug 21 17:46:36 2014 -0400
    wayland: Record the offset position
    
    This is needed for DND surfaces. We should probably test to see if it's
    used for cursor surfaces at all.
 src/wayland/meta-wayland-surface.c |    3 +++
 src/wayland/meta-wayland-surface.h |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 6581f54..cf840e5 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -429,6 +429,9 @@ commit_pending_state (MetaWaylandSurface      *surface,
   if (!cairo_region_is_empty (pending->damage))
     surface_process_damage (surface, pending->damage);
 
+  surface->offset_x += pending->dx;
+  surface->offset_y += pending->dy;
+
   if (pending->opaque_region)
     {
       pending->opaque_region = scale_region (pending->opaque_region, surface->scale);
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index 6a0c4ca..30940a4 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -115,6 +115,8 @@ struct _MetaWaylandSurface
     GSList *pending_placement_ops;
   } sub;
 
+  int32_t offset_x, offset_y;
+
   gboolean has_set_geometry;
 
   /* All the pending state that wl_surface.commit will apply. */
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]