}
else if (e->clas == ECORE_DEVICE_CLASS_KEYBOARD)
{
- if (!e_input_thread_mode_get())
- {
- e_comp_input_key->kbd.num_devices++;
- e_comp_wl_input_keyboard_enabled_set(EINA_TRUE);
- }
+ e_comp_input_key->kbd.num_devices++;
+ if (e_comp_input_key->kbd.num_devices == 1)
+ e_comp_wl_input_keyboard_enabled_set(EINA_TRUE);
}
else if (e->clas == ECORE_DEVICE_CLASS_TOUCH)
{
_e_comp_screen_pointer_renew();
}
}
+ else if (e->clas == ECORE_DEVICE_CLASS_KEYBOARD)
+ {
+ e_comp_input_key->kbd.num_devices--;
+ if (e_comp_input_key->kbd.num_devices == 0)
+ {
+ e_comp_wl_input_keyboard_enabled_set(EINA_FALSE);
+ }
+ }
else if (e->clas == ECORE_DEVICE_CLASS_TOUCH)
{
comp_wl->touch.num_devices--;
e_device_class_set(e_dev, clas);
e_device_subclass_set(e_dev, subclas);
- if (e_input_thread_mode_get())
- {
- if (clas == ECORE_DEVICE_CLASS_KEYBOARD)
- {
- e_comp_input_key->kbd.num_devices++;
- e_comp_wl_input_keyboard_enabled_set(EINA_TRUE);
- }
- }
-
if (!evdev->e_dev)
{
if (!evdev->e_dev_list || (g_list_length(evdev->e_dev_list) == 0))
if ((e_device_class_get(device) == clas) && (!strcmp(device_identifier, evdev->path)))
{
- if (clas == ECORE_DEVICE_CLASS_KEYBOARD)
- {
- e_comp_input_key->kbd.num_devices--;
- if (e_comp_input_key->kbd.num_devices == 0)
- e_comp_wl_input_keyboard_enabled_set(EINA_FALSE);
- }
-
device_remove_log = eina_stringshare_printf("[Remove Device] device name(%s), identifier(%s), class(%s), subclass(%d)",
e_device_name_get(device),
device_identifier,
_e_comp_wl_input_update_seat_caps(comp_wl, NULL);
}
-static void
-_e_comp_wl_input_thread_cb_keyboard_enabled_set(void *data)
-{
- Eina_Bool enabled;
- EINA_SAFETY_ON_NULL_RETURN(data);
-
- enabled = *(Eina_Bool *)data;
-
- e_comp_input_key->kbd.enabled = !!enabled;
-}
-
EINTERN void
e_comp_wl_input_keyboard_enabled_set(Eina_Bool enabled)
{
return;
}
- e_input_backend_thread_safe_call(_e_comp_wl_input_thread_cb_keyboard_enabled_set, &enabled, sizeof(Eina_Bool));
+ e_comp_input_key->kbd.enabled = !!enabled;
_e_comp_wl_input_update_seat_caps(comp_wl, NULL);
}