From f0289a193697adf324406cdd9d2b491f4472858f Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 23 Jul 2013 07:12:40 +0100 Subject: [PATCH] Check for valid input->pointer before calling wl_pointer_set_cursor. During a pointer_enter event, if the window was assigned a custom cursor, respect it. By default we will still set left_arrow initially, but if the window was assigned a custom cursor, use it. NB: Fixes Phab T230 Signed-off-by: Chris Michael --- src/lib/ecore_wayland/ecore_wl_input.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index ec533ead51..1cde8c0016 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c @@ -182,8 +182,9 @@ ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_surface *surface, in if (!input) return; _pointer_update_stop(input); - wl_pointer_set_cursor(input->pointer, input->pointer_enter_serial, - surface, hot_x, hot_y); + if (input->pointer) + wl_pointer_set_cursor(input->pointer, input->pointer_enter_serial, + surface, hot_x, hot_y); } static Eina_Bool @@ -801,6 +802,18 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU win->pointer_device = input; input->pointer_focus = win; + if (win->pointer.set) + { + ecore_wl_input_pointer_set(input, win->pointer.surface, + win->pointer.hot_x, win->pointer.hot_y); + } + /* NB: Commented out for now. Not needed in most circumstances, + * but left here for any corner-cases */ + /* else */ + /* { */ + /* _ecore_wl_input_cursor_update(input); */ + /* } */ + _ecore_wl_input_mouse_in_send(input, win, input->timestamp); } @@ -849,6 +862,10 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU input->display->serial = serial; + /* NB: Commented out for now. Not needed in most circumstances, but left + * here for any corner-cases */ + /* _ecore_wl_input_cursor_update(input); */ + if (!surface) return; if (!(win = ecore_wl_window_surface_find(surface))) return;