[clutter] wayland: Attach cursor buffer to input device when it enters the surface



commit a9e6137f4727750e391b105581b4fd17acb09c31
Author: Rob Bradford <rob linux intel com>
Date:   Tue Jan 10 17:25:35 2012 +0000

    wayland: Attach cursor buffer to input device when it enters the surface
    
    The Wayland semantics mean that we must attach a buffer to the input device
    when the pointer enters the surface to provide a cursor.

 clutter/wayland/clutter-input-device-wayland.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/clutter/wayland/clutter-input-device-wayland.c b/clutter/wayland/clutter-input-device-wayland.c
index bb9f942..1abd57a 100644
--- a/clutter/wayland/clutter-input-device-wayland.c
+++ b/clutter/wayland/clutter-input-device-wayland.c
@@ -39,6 +39,7 @@
 #include "clutter-keysyms.h"
 #include "evdev/clutter-xkb-utils.h"
 #include "clutter-input-device-wayland.h"
+#include "clutter-backend-wayland.h"
 
 #include "cogl/clutter-stage-cogl.h"
 
@@ -165,6 +166,9 @@ clutter_wayland_handle_pointer_focus (void *data,
 
   if (surface)
     {
+      ClutterBackend        *backend;
+      ClutterBackendWayland *backend_wayland;
+
       stage_cogl = wl_surface_get_user_data (surface);
 
       device->pointer_focus = stage_cogl;
@@ -186,8 +190,15 @@ clutter_wayland_handle_pointer_focus (void *data,
       device->x = x;
       device->y = y;
 
-      /* Revert back to default pointer for now. */
-      wl_input_device_attach (input_device, _time, NULL, 0, 0);
+      /* Set the cursor to the cursor loaded at backend initialisation */
+      backend = clutter_get_default_backend ();
+      backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
+
+      wl_input_device_attach (input_device,
+                              _time,
+                              backend_wayland->cursor_buffer,
+                              backend_wayland->cursor_x,
+                              backend_wayland->cursor_y);
     }
 }
 



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