From f7b68cb197aaa0347e64b8aa69492b28f7c28d10 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Wed, 7 Oct 2015 14:30:21 +0900 Subject: [PATCH] ecore_wayland: Send 'get_supported_aux_hints' only when window calls 'elm_win_aux_hint_add' Change-Id: I926570d93078603d051b52182d6ff04076b267cc Signed-off-by: Duna Oh --- src/lib/ecore_evas/ecore_evas.c | 17 +++++++++++++ src/lib/ecore_evas/ecore_evas_wayland.h | 1 + .../engines/wayland/ecore_evas_wayland_common.c | 29 +++++++++++----------- .../engines/wayland/ecore_evas_wayland_egl.c | 2 -- .../engines/wayland/ecore_evas_wayland_private.h | 1 - .../engines/wayland/ecore_evas_wayland_shm.c | 2 -- 6 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index dee1256..210a627 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -2210,6 +2210,23 @@ ecore_evas_aux_hint_add(Ecore_Evas *ee, const char *hint, const char *val) Eina_List *ll; char *supported_hint; + if (ee->prop.aux_hint.supported_list == NULL) + { + if (!strncmp(ee->driver, "wayland", 7)) + { + Ecore_Evas_Interface_Wayland *iface; + iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland"); + EINA_SAFETY_ON_NULL_RETURN_VAL(iface, -1); + + if (iface->aux_hint_add) + iface->supported_aux_hints_get(ee); + + if (ee->prop.aux_hint.supported_list == NULL) + return -1; + } + else + return -1; + } EINA_LIST_FOREACH(ee->prop.aux_hint.supported_list, ll, supported_hint) { if (!strncmp(supported_hint, hint, strlen(hint))) diff --git a/src/lib/ecore_evas/ecore_evas_wayland.h b/src/lib/ecore_evas/ecore_evas_wayland.h index 81461a3..80e7b04 100644 --- a/src/lib/ecore_evas/ecore_evas_wayland.h +++ b/src/lib/ecore_evas/ecore_evas_wayland.h @@ -16,6 +16,7 @@ struct _Ecore_Evas_Interface_Wayland void (*aux_hint_add)(Ecore_Evas *ee, int id, const char *hint, const char *val); void (*aux_hint_change)(Ecore_Evas *ee, int id, const char *val); void (*aux_hint_del)(Ecore_Evas *ee, int id); + void (*supported_aux_hints_get)(Ecore_Evas *ee); }; #endif diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 693024e..2b3fa2d 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -1316,18 +1316,6 @@ _ecore_evas_wl_common_wm_rot_manual_rotation_done(Ecore_Evas *ee) } void -_ecore_evas_wl_common_aux_hints_supported_update(Ecore_Evas *ee) -{ - Ecore_Evas_Engine_Wl_Data *wdata; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - if (!ee) return; - wdata = ee->engine.data; - ee->prop.aux_hint.supported_list = ecore_wl_window_aux_hints_supported_get(wdata->win); -} - -void _ecore_evas_wl_common_raise(Ecore_Evas *ee) { Ecore_Evas_Engine_Wl_Data *wdata; @@ -1994,7 +1982,17 @@ _ecore_evas_wayland_pointer_set(Ecore_Evas *ee EINA_UNUSED, int hot_x EINA_UNUSE } static void -_ecore_evas_wayland_aux_hint_add(Ecore_Evas *ee EINA_UNUSED, int id, const char *hint, const char *val) +_ecore_evas_wayland_supported_aux_hints_get(Ecore_Evas *ee) +{ + Ecore_Evas_Engine_Wl_Data *wdata; + + if (!ee) return; + wdata = ee->engine.data; + ee->prop.aux_hint.supported_list = ecore_wl_window_aux_hints_supported_get(wdata->win); +} + +static void +_ecore_evas_wayland_aux_hint_add(Ecore_Evas *ee, int id, const char *hint, const char *val) { Ecore_Evas_Engine_Wl_Data *wdata; @@ -2004,7 +2002,7 @@ _ecore_evas_wayland_aux_hint_add(Ecore_Evas *ee EINA_UNUSED, int id, const char } static void -_ecore_evas_wayland_aux_hint_change(Ecore_Evas *ee EINA_UNUSED, int id, const char *val) +_ecore_evas_wayland_aux_hint_change(Ecore_Evas *ee, int id, const char *val) { Ecore_Evas_Engine_Wl_Data *wdata; @@ -2014,7 +2012,7 @@ _ecore_evas_wayland_aux_hint_change(Ecore_Evas *ee EINA_UNUSED, int id, const ch } static void -_ecore_evas_wayland_aux_hint_del(Ecore_Evas *ee EINA_UNUSED, int id) +_ecore_evas_wayland_aux_hint_del(Ecore_Evas *ee, int id) { Ecore_Evas_Engine_Wl_Data *wdata; @@ -2042,6 +2040,7 @@ _ecore_evas_wl_interface_new(void) iface->aux_hint_add = _ecore_evas_wayland_aux_hint_add; iface->aux_hint_change = _ecore_evas_wayland_aux_hint_change; iface->aux_hint_del = _ecore_evas_wayland_aux_hint_del; + iface->supported_aux_hints_get = _ecore_evas_wayland_supported_aux_hints_get; #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL iface->pre_post_swap_callback_set = diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c index 9356ee6..75097b0 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c @@ -257,8 +257,6 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent, evas_object_layer_set(wdata->frame, EVAS_LAYER_MAX - 1); } - _ecore_evas_wl_common_aux_hints_supported_update(ee); - ee->engine.func->fn_render = _ecore_evas_wl_common_render; _ecore_evas_register(ee); diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h index 0a2475e..2f8585d 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -108,7 +108,6 @@ void _ecore_evas_wl_common_wm_rot_preferred_rotation_set(Ecore_Evas *ee, int rot void _ecore_evas_wl_common_wm_rot_available_rotations_set(Ecore_Evas *ee, const int *rots, unsigned int count); void _ecore_evas_wl_common_wm_rot_manual_rotation_done_set(Ecore_Evas *ee, Eina_Bool set); void _ecore_evas_wl_common_wm_rot_manual_rotation_done(Ecore_Evas *ee); -void _ecore_evas_wl_common_aux_hints_supported_update(Ecore_Evas *ee); #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location); diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c index 396831a..b04c7e1 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c @@ -255,8 +255,6 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent, evas_object_layer_set(wdata->frame, EVAS_LAYER_MAX - 1); } - _ecore_evas_wl_common_aux_hints_supported_update(ee); - ee->engine.func->fn_render = _ecore_evas_wl_common_render; _ecore_evas_register(ee); -- 2.7.4