[mutter/wip/tablet-protocol: 44/50] core: Update tablet cursors



commit 5a2c93707ed36dea7413b42604d615fc7d916cbc
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jan 9 17:31:02 2015 +0100

    core: Update tablet cursors
    
    On wayland, tablets have their standalone pointer, which must be updated
    on events from the corresponding device.

 src/core/events.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/src/core/events.c b/src/core/events.c
index 5cd88b5..35bb914 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -199,8 +199,20 @@ meta_display_handle_event (MetaDisplay        *display,
 
   if (meta_is_wayland_compositor () && event->type == CLUTTER_MOTION)
     {
-      MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (NULL);
-      meta_cursor_tracker_update_position (tracker, event->motion.x, event->motion.y);
+      MetaWaylandCompositor *compositor;
+
+      compositor = meta_wayland_compositor_get_default ();
+
+      if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager, event))
+        {
+          meta_wayland_tablet_manager_update_cursor_position (compositor->tablet_manager, event);
+        }
+      else
+        {
+          MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (NULL);
+          meta_cursor_tracker_update_position (tracker, event->motion.x, event->motion.y);
+        }
+
       display->monitor_cache_invalidated = TRUE;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]