From 96f53fc69dbec76e17d74b39b3dbee317f545750 Mon Sep 17 00:00:00 2001 From: Srivardhan Hebbar Date: Fri, 26 Sep 2014 08:02:25 -0400 Subject: [PATCH] ecore_wayland: Added cursor_name to Ecore_Wl_Window. Summary: Added cursor_name to Ecore_Wl_Window so that we can compare with input cursor name and avoid unnecessary cursor set calls to wayland. Signed-off-by: Srivardhan Hebbar Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1481 --- src/lib/ecore_wayland/ecore_wl_private.h | 3 +-- src/lib/ecore_wayland/ecore_wl_window.c | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h index a86a74c578..dfb3aba6fd 100644 --- a/src/lib/ecore_wayland/ecore_wl_private.h +++ b/src/lib/ecore_wayland/ecore_wl_private.h @@ -156,8 +156,7 @@ struct _Ecore_Wl_Window Eina_Bool anim_pending : 1; struct wl_callback *anim_callback; - /* FIXME: Ideally we should record the cursor name for this window - * so we can compare and avoid unnecessary cursor set calls to wayland */ + const char *cursor_name; Ecore_Wl_Subsurf *subsurfs; diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 13a4e7b9e3..84e89540d8 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -571,7 +571,12 @@ ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_na win->pointer.set = EINA_FALSE; - if ((input = win->pointer_device)) + if (!(input = win->pointer_device)) + return; + + eina_stringshare_replace(&win->cursor_name, cursor_name); + + if (strcmp(input->cursor_name, win->cursor_name)) ecore_wl_input_cursor_from_name_set(input, cursor_name); }