devilhorns pushed a commit to branch master.

commit 98bc3ae1b50ca3aa255ad174f54abc43a5e18111
Author: Chris Michael <[email protected]>
Date:   Thu Apr 11 12:18:10 2013 +0100

    Add code to update the pointer cursor image for wayland clients.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/bin/e_comp_wl.c | 51 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index f738349..1ab8c4c 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -975,32 +975,35 @@ _e_comp_wl_pointer_configure(E_Wayland_Surface *ews, 
Evas_Coord x, Evas_Coord y,
          * using the pixels from their cursor surface */
 
         /* is it mapped ? */
-        /* FIXME !!! Use Smart Object */
-        /* if ((focus->mapped) && (focus->ee)) */
-        /*   { */
-        /*      Ecore_Window win; */
+        if ((focus->mapped) && (focus->ee))
+          {
+             Ecore_Window win;
 
              /* try to get the ecore_window */
-             /* if ((win = ecore_evas_window_get(focus->ee))) */
-             /*   { */
-             /*      void *pixels; */
-             /*      Ecore_X_Cursor cur; */
+             if ((win = ecore_evas_window_get(focus->ee)))
+               {
+                  void *pixels;
 
                   /* grab the pixels from the cursor surface */
-                  /* pixels = wl_shm_buffer_get_data(ews->reference.buffer); */
-
-                  /* create the new X cursor with this image */
-                  /* cur = ecore_x_cursor_new(win, pixels, w, h, */
-                  /*                          input->pointer.hot.x,  */
-                  /*                          input->pointer.hot.y); */
-
-                  /* set the cursor on this window */
-                  /* ecore_x_window_cursor_set(win, cur); */
-
-                  /* free the cursor */
-                  /* ecore_x_cursor_free(cur); */
-               /* } */
-          /* } */
+                  if ((pixels = wl_shm_buffer_get_data(ews->reference.buffer)))
+                    {
+                       Ecore_X_Cursor cur;
+
+                       /* create the new X cursor with this image */
+                       cur = ecore_x_cursor_new(win, pixels, w, h,
+                                                input->pointer.hot.x, 
+                                                input->pointer.hot.y);
+
+                       /* set the cursor on this window */
+                       ecore_x_window_cursor_set(win, cur);
+
+                       /* free the cursor */
+                       ecore_x_cursor_free(cur);
+                    }
+                  else
+                    ecore_x_window_cursor_set(win, 0);
+               }
+          }
      }
 }
 
@@ -1065,6 +1068,9 @@ _e_comp_wl_pointer_cb_cursor_set(struct wl_client 
*client, struct wl_resource *r
           input->pointer.surface->unmap(input->pointer.surface);
      }
 
+   input->pointer.surface = ews;
+
+   /* if we don't have a pointer surface, we are done here */
    if (!ews) return;
 
    /* set the destroy listener */
@@ -1077,7 +1083,6 @@ _e_comp_wl_pointer_cb_cursor_set(struct wl_client 
*client, struct wl_resource *r
    ews->input = input;
 
    /* update input structure with new values */
-   input->pointer.surface = ews;
    input->pointer.hot.x = x;
    input->pointer.hot.y = y;
 

-- 

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

Reply via email to