devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6699d427c1687d5ab4279a0d4753181d939a5bea

commit 6699d427c1687d5ab4279a0d4753181d939a5bea
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Tue Apr 15 10:36:37 2014 +0100

    ecore-wl: Don't create an input cursor surface unless the input has pointer 
capability.
    
    @fix: There is no use for an input cursor surface if the seat does not
    have the pointer ability (for kiosk cases, or touch-only cases where
    a pointer is not created).
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wayland/ecore_wl_input.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_wayland/ecore_wl_input.c 
b/src/lib/ecore_wayland/ecore_wl_input.c
index 952458b..3d5ff87 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -354,8 +354,6 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
                                             input->seat);
    wl_data_device_add_listener(input->data_device, 
                                &_ecore_wl_data_listener, input);
-   input->cursor_surface = 
-     wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
 
    ewd->input = input;
 }
@@ -447,14 +445,24 @@ _ecore_wl_input_seat_handle_capabilities(void *data, 
struct wl_seat *seat, enum
 
    if (!(input = data)) return;
 
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
    if ((caps & WL_SEAT_CAPABILITY_POINTER) && (!input->pointer))
      {
         input->pointer = wl_seat_get_pointer(seat);
         wl_pointer_set_user_data(input->pointer, input);
         wl_pointer_add_listener(input->pointer, &pointer_listener, input);
+
+        if (!input->cursor_surface)
+          {
+             input->cursor_surface = 
+               wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
+          }
      }
    else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && (input->pointer))
      {
+        if (input->cursor_surface) wl_surface_destroy(input->cursor_surface);
+        input->cursor_surface = NULL;
         wl_pointer_destroy(input->pointer);
         input->pointer = NULL;
      }

-- 


Reply via email to