From: duna.oh Date: Wed, 21 May 2025 07:28:01 +0000 (+0900) Subject: e_comp_wl: fix to send wl_array of keycodes in wl_keyboard.enter event X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a383f11a92bbd4b01fdc77e206e759fbb4e767f6;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl: fix to send wl_array of keycodes in wl_keyboard.enter event Change-Id: Iee890836ff6c8f6598f1e6241e45075df8ba2de2 --- diff --git a/src/bin/server/e_comp_wl.c b/src/bin/server/e_comp_wl.c index 1a52f50bf1..c6600f2b8b 100644 --- a/src/bin/server/e_comp_wl.c +++ b/src/bin/server/e_comp_wl.c @@ -88,12 +88,6 @@ static Eina_Bool _e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Comp static void _e_comp_wl_surface_state_serial_update(E_Client *ec, E_Comp_Wl_Surface_State *state); /* local variables */ -typedef struct _E_Comp_Wl_Key_Data -{ - uint32_t key; - E_Device *dev; -} E_Comp_Wl_Key_Data; - struct _E_Comp_Wl_Evas_Gl { Evas_GL *gl; diff --git a/src/bin/server/e_comp_wl_input.c b/src/bin/server/e_comp_wl_input.c index beffce31b8..0203af410c 100644 --- a/src/bin/server/e_comp_wl_input.c +++ b/src/bin/server/e_comp_wl_input.c @@ -397,6 +397,10 @@ e_comp_wl_input_keyboard_enter_send(struct wl_resource *surface) xkb_mod_mask_t mod_depressed, mod_latched, mod_locked; xkb_layout_index_t mod_group; E_Comp_Wl_Data *comp_wl; + E_Comp_Wl_Key_Data *k; + uint32_t *key; + struct wl_array keys; + int key_cnt = 0; g_rec_mutex_lock(&e_comp_input_key->kbd.focused_mutex); if (!e_comp_input_key->kbd.focused) @@ -417,11 +421,22 @@ e_comp_wl_input_keyboard_enter_send(struct wl_resource *surface) mod_group = atomic_load(&e_comp_input_key->kbd.mod_group); + wl_array_init(&keys); + wl_array_for_each(k, &e_comp_input_key->kbd.keys) + { + if (!(key = wl_array_add(&keys, sizeof(uint32_t)))) + { + DBG("wl_array_add: Out of memory\n"); + } + key_cnt++; + *key = k->key; + } + g_rec_mutex_lock(&e_comp_input_key->kbd.focused_mutex); EINA_LIST_FOREACH(e_comp_input_key->kbd.focused, l, res) { wl_keyboard_send_enter(res, serial, surface, - &e_comp_input_key->kbd.keys); + &keys); wl_keyboard_send_modifiers(res, serial, mod_depressed, @@ -430,6 +445,8 @@ e_comp_wl_input_keyboard_enter_send(struct wl_resource *surface) mod_group); } g_rec_mutex_unlock(&e_comp_input_key->kbd.focused_mutex); + + wl_array_release(&keys); } static enum wl_iterator_result diff --git a/src/bin/server/e_comp_wl_intern.h b/src/bin/server/e_comp_wl_intern.h index b6fe53bf14..aa4da9e04e 100644 --- a/src/bin/server/e_comp_wl_intern.h +++ b/src/bin/server/e_comp_wl_intern.h @@ -6,6 +6,14 @@ #include "e_policy_wl.h" #include "e_device_intern.h" + +typedef struct _E_Comp_Wl_Key_Data E_Comp_Wl_Key_Data; +struct _E_Comp_Wl_Key_Data +{ + uint32_t key; + E_Device *dev; +}; + EINTERN E_Comp_Wl_Data *e_comp_wl_init(void); EINTERN void e_comp_wl_shutdown(void); EINTERN E_Comp_Wl_Data *e_comp_wl_get(void);