From: Sungjin Park Date: Tue, 25 Apr 2023 11:25:02 +0000 (+0900) Subject: e_comp_wl & e_comp_wl_input: added signal emitters for pointer constraints X-Git-Tag: accepted/tizen/7.0/unified/20230502.051241~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F292009%2F1;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl & e_comp_wl_input: added signal emitters for pointer constraints Change-Id: I868c98a32d62bbb722950ed40e1f4228ce661364 Signed-off-by: Sungjin Park --- diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 72a342e950..457761a16c 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -657,6 +657,8 @@ _e_comp_wl_evas_cb_hide(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EIN if (ec->comp_data->sub.below_obj) evas_object_hide(ec->comp_data->sub.below_obj); + + wl_signal_emit(&e_comp_wl->ptr_constraints.surface_unmap_signal, ec); } static void @@ -3923,6 +3925,7 @@ _e_comp_wl_client_cb_focus_set(void *data EINA_UNUSED, E_Client *ec) } e_comp_wl->kbd.focus = ec->comp_data->surface; + wl_signal_emit(&e_comp_wl->ptr_constraints.surface_focus_signal, ec); } static void diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 8c2f9bf119..9e56197363 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -48,6 +48,8 @@ static Eina_Bool dont_set_e_input_keymap = EINA_FALSE; static Eina_Bool dont_use_xkb_cache = EINA_FALSE; static Eina_Bool use_cache_keymap = EINA_FALSE; +static E_Comp_Wl_Hook *_surface_commit_hook = NULL; + /* default XKB values from enviroment variables */ static char *_env_e_default_xkb_rules = NULL; static char *_env_e_default_xkb_model = NULL; @@ -208,6 +210,8 @@ _e_comp_wl_input_cb_pointer_unbind(struct wl_resource *resource) { e_comp_wl->ptr.resources = eina_list_remove(e_comp_wl->ptr.resources, resource); + + wl_signal_emit(&e_comp_wl->ptr_constraints.pointer_destroy_signal, resource); } static void @@ -1096,6 +1100,12 @@ _e_comp_wl_input_cb_bind_pointer_constraints(struct wl_client *client, void *dat NULL, _e_comp_wl_input_cb_unbind_pointer_constraints); } +static void +_e_comp_wl_input_cb_surface_commit(void *data EINA_UNUSED, E_Client *ec) +{ + wl_signal_emit(&e_comp_wl->ptr_constraints.surface_commit_signal, ec); +} + static void _e_comp_wl_input_keymap_cache_create(const char *keymap_path, char *keymap_data) { @@ -1349,6 +1359,11 @@ e_comp_wl_input_init(void) wl_signal_init(&e_comp_wl->ptr_constraints.surface_commit_signal); wl_signal_init(&e_comp_wl->ptr_constraints.surface_focus_signal); + _surface_commit_hook = e_comp_wl_hook_add(E_COMP_WL_HOOK_CLIENT_SURFACE_COMMIT, + _e_comp_wl_input_cb_surface_commit, + NULL); + + wl_array_init(&e_comp_wl->kbd.keys); wl_array_init(&e_comp_wl->kbd.routed_keys); @@ -1376,6 +1391,13 @@ e_comp_wl_input_shutdown(void) E_FREE(_env_e_default_xkb_variant); E_FREE(_env_e_default_xkb_opts ); + /* delete surface commit hook */ + if (_surface_commit_hook) + { + e_comp_wl_hook_del(_surface_commit_hook); + _surface_commit_hook = NULL; + } + /* destroy pointer resources */ EINA_LIST_FREE(e_comp_wl->ptr.resources, res) wl_resource_destroy(res);