void *internal_cb_data;
} block;
- Eina_List *pressed_keys;
- unsigned int pressed_button;
- unsigned int pressed_finger;
-
int virtual_key_device_fd;
int virtual_mouse_device_fd;
static void _e_devicemgr_block_client_cb_destroy(struct wl_listener *l, void *data);
-Eina_Bool
-e_devicemgr_block_check_keyboard(Ecore_Event_Key *ev, Eina_Bool pressed)
-{
- Eina_List *l, *l_next;
- int *keycode, *data;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
-
- if ((e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD) ||
- (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD))
- {
- if (!pressed)
- {
- EINA_LIST_FOREACH_SAFE(e_devicemgr->pressed_keys, l, l_next, data)
- {
- if (ev->keycode == *data)
- {
- DMERR("%d is already press key. Propagate this key event.\n", *data);
- e_devicemgr->pressed_keys = eina_list_remove_list(e_devicemgr->pressed_keys, l);
- E_FREE(data);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
- }
- return ECORE_CALLBACK_DONE;
- }
-
- if (pressed)
- {
- keycode = E_NEW(int, 1);
- EINA_SAFETY_ON_NULL_RETURN_VAL(keycode, ECORE_CALLBACK_PASS_ON);
-
- *keycode = ev->keycode;
-
- EINA_LIST_FOREACH(e_devicemgr->pressed_keys, l, data)
- {
- if (*data == *keycode)
- {
- E_FREE(keycode);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
- e_devicemgr->pressed_keys = eina_list_append(e_devicemgr->pressed_keys, keycode);
- }
- else
- {
- EINA_LIST_FOREACH_SAFE(e_devicemgr->pressed_keys, l, l_next, data)
- {
- if (ev->keycode == *data)
- {
- e_devicemgr->pressed_keys = eina_list_remove_list(e_devicemgr->pressed_keys, l);
- E_FREE(data);
- }
- }
- }
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
-Eina_Bool
-e_devicemgr_block_check_button(Ecore_Event_Mouse_Button *ev, Eina_Bool pressed)
-{
- Ecore_Device *dev;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
- dev = ev->dev;
- EINA_SAFETY_ON_NULL_RETURN_VAL(dev, ECORE_CALLBACK_PASS_ON);
-
- if (ecore_device_class_get(dev) == ECORE_DEVICE_CLASS_MOUSE)
- {
- if ((e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE) ||
- (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE))
- {
- if (!pressed)
- {
- if (e_devicemgr->pressed_button & (1 << ev->buttons))
- {
- e_devicemgr->pressed_button &= ~(1 << ev->buttons);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
- return ECORE_CALLBACK_DONE;
- }
-
- if (pressed)
- {
- e_devicemgr->pressed_button |= (1 << ev->buttons);
- }
- else
- e_devicemgr->pressed_button &= ~(1 << ev->buttons);
- }
- else if (ecore_device_class_get(dev) == ECORE_DEVICE_CLASS_TOUCH)
- {
- if ((e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN) ||
- (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN))
- {
- if (!pressed)
- {
- if (e_devicemgr->pressed_finger & (1 << ev->multi.device))
- {
- e_devicemgr->pressed_finger &= ~(1 << ev->multi.device);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
- return ECORE_CALLBACK_DONE;
- }
-
- if (pressed)
- {
- e_devicemgr->pressed_finger |= (1 << ev->multi.device);
- }
- else
- e_devicemgr->pressed_finger &= ~(1 << ev->multi.device);
- }
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
-Eina_Bool
-e_devicemgr_block_check_move(Ecore_Event_Mouse_Move *ev)
-{
- Ecore_Device *dev;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
- dev = ev->dev;
- EINA_SAFETY_ON_NULL_RETURN_VAL(dev, ECORE_CALLBACK_PASS_ON);
-
- if (ecore_device_class_get(dev) == ECORE_DEVICE_CLASS_MOUSE)
- {
- if ((e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE) ||
- (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE))
- {
- return ECORE_CALLBACK_DONE;
- }
- }
- else if (ecore_device_class_get(dev) == ECORE_DEVICE_CLASS_TOUCH)
- {
- if ((e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN) ||
- (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN))
- {
- return ECORE_CALLBACK_DONE;
- }
- }
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
static void
_e_devicemgr_block_client_remove(struct wl_client *client)
{
struct wl_listener *destroy_listener = NULL;
+ Eina_List *dev_list, *l;
+ E_Input_Device *device_data;
+ Eina_Bool res = EINA_TRUE;
if (client != e_devicemgr->block.client) return;
E_FREE(destroy_listener);
}
+ dev_list = (Eina_List *)e_input_devices_get();
+ EINA_LIST_FOREACH(dev_list, l, device_data)
+ {
+ res = e_input_device_unblock(device_data, client);
+ if (!res) DMWRN("Failed to request unblock client: %p", client);
+ }
}
static Eina_Bool
{
struct wl_listener *destroy_listener = NULL;
double milli_duration = (double)(duration) / 1000.0;
+ unsigned int block_type = 0x0;
+ Eina_List *dev_list, *l;
+ E_Input_Device *device_data;
+ Eina_Bool res = EINA_TRUE;
/* Last request of block can renew timer time */
if (e_devicemgr->block.duration_timer)
destroy_listener->notify = _e_devicemgr_block_client_cb_destroy;
wl_client_add_destroy_listener(client, destroy_listener);
+ if (e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE)
+ {
+ block_type |= E_INPUT_SEAT_POINTER;
+ }
+ if (e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD)
+ {
+ block_type |= E_INPUT_SEAT_KEYBOARD;
+ }
+ if (e_devicemgr->block.devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN)
+ {
+ block_type |= E_INPUT_SEAT_TOUCH;
+ }
+
+ dev_list = (Eina_List *)e_input_devices_get();
+ EINA_LIST_FOREACH(dev_list, l, device_data)
+ {
+ res = e_input_device_block(device_data, block_type, client);
+ if (!res) DMWRN("Failed to request block block_type: 0x%x, client: %p", block_type, client);
+ }
+
return;
failed:
static Eina_Bool
_e_devicemgr_block_timer_internal(void *data)
{
+ Eina_List *dev_list, *l;
+ E_Input_Device *device_data;
+ Eina_Bool res;
+
e_devicemgr->block.internal_devtype = 0x0;
e_devicemgr->block.internal_duration_timer = NULL;
e_devicemgr->block.internal_cb_func = NULL;
e_devicemgr->block.internal_cb_data = NULL;
+ dev_list = (Eina_List *)e_input_devices_get();
+ EINA_LIST_FOREACH(dev_list, l, device_data)
+ {
+ res = e_input_device_unblock(device_data, E_INPUT_REQUEST_SERVER);
+ if (!res) DMWRN("Failed to request unblock by server");
+ }
+
return ECORE_CALLBACK_DONE;
}
uint32_t all_class = TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE |
TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD |
TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN;
+ unsigned int block_type = 0x0;
+ Eina_List *dev_list, *l;
+ E_Input_Device *device_data;
+ Eina_Bool res;
if (!(clas & all_class)) return EINA_FALSE;
e_devicemgr->block.internal_cb_func = cb_func;
e_devicemgr->block.internal_cb_data = cb_data;
+ if (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE)
+ {
+ block_type |= E_INPUT_SEAT_POINTER;
+ }
+ if (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD)
+ {
+ block_type |= E_INPUT_SEAT_KEYBOARD;
+ }
+ if (e_devicemgr->block.internal_devtype & TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN)
+ {
+ block_type |= E_INPUT_SEAT_TOUCH;
+ }
+
+ dev_list = (Eina_List *)e_input_devices_get();
+ EINA_LIST_FOREACH(dev_list, l, device_data)
+ {
+ res = e_input_device_block(device_data, block_type, E_INPUT_REQUEST_SERVER);
+ if (!res) DMWRN("Failed to request block block_type: 0x%x by server", block_type);
+ }
+
return EINA_TRUE;
}
Eina_Bool
e_devicemgr_block_remove_internal(E_Devicemgr_Block_Expire_Cb cb_func, void *cb_data)
{
+ Eina_List *dev_list, *l;
+ E_Input_Device *device_data;
+ Eina_Bool res;
+
if ((e_devicemgr->block.internal_cb_func != cb_func) ||
(e_devicemgr->block.internal_cb_data != cb_data)) return EINA_FALSE;
e_devicemgr->block.internal_cb_func = NULL;
e_devicemgr->block.internal_cb_data = NULL;
+ dev_list = (Eina_List *)e_input_devices_get();
+ EINA_LIST_FOREACH(dev_list, l, device_data)
+ {
+ res = e_input_device_unblock(device_data, E_INPUT_REQUEST_SERVER);
+ if (!res) DMWRN("Failed to request unblock by server");
+ }
+
return EINA_TRUE;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(event, res);
ev = (Ecore_Event_Mouse_Button *)event;
- res = e_devicemgr_block_check_button(ev, EINA_TRUE);
- if (res == ECORE_CALLBACK_DONE) return res;
-
if (e_devicemgr->dconfig->conf->input.button_remap_enable)
res = _e_devicemgr_input_mouse_button_remap(ev, EINA_TRUE);
EINA_SAFETY_ON_NULL_RETURN_VAL(event, res);
ev = (Ecore_Event_Mouse_Button *)event;
- res = e_devicemgr_block_check_button(ev, EINA_FALSE);
- if (res == ECORE_CALLBACK_DONE) return res;
-
if (e_devicemgr->dconfig->conf->input.button_remap_enable)
res = _e_devicemgr_input_mouse_button_remap(ev, EINA_FALSE);
}
static Eina_Bool
-_e_devicemgr_input_cb_mouse_move(void *data, int type, void *event)
-{
- Ecore_Event_Mouse_Move *ev;
- Eina_Bool res = ECORE_CALLBACK_PASS_ON;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(event, res);
- ev = (Ecore_Event_Mouse_Move *)event;
-
- res = e_devicemgr_block_check_move(ev);
-
- return res;
-}
-
-static Eina_Bool
_e_devicemgr_input_cb_mouse_wheel(void *data, int type, void *event)
{
Ecore_Event_Mouse_Wheel *ev;
return ECORE_CALLBACK_PASS_ON;
}
-static Eina_Bool
-_e_devicemgr_input_cb_key_down(void *data, int type, void *event)
-{
- Ecore_Event_Key *ev;
- Eina_Bool res = ECORE_CALLBACK_PASS_ON;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(event, ECORE_CALLBACK_PASS_ON);
- ev = (Ecore_Event_Key *)event;
-
- res = e_devicemgr_block_check_keyboard(ev, EINA_TRUE);
-
- return res;
-}
-
-static Eina_Bool
-_e_devicemgr_input_cb_key_up(void *data, int type, void *event)
-{
- Ecore_Event_Key *ev;
- Eina_Bool res = ECORE_CALLBACK_PASS_ON;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(event, ECORE_CALLBACK_PASS_ON);
- ev = (Ecore_Event_Key *)event;
-
- res = e_devicemgr_block_check_keyboard(ev, EINA_FALSE);
-
- return res;
-}
-
Eina_Bool
e_devicemgr_input_init(void)
{
E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_devicemgr_input_cb_mouse_button_down, NULL);
E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_devicemgr_input_cb_mouse_button_up, NULL);
- E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_MOUSE_MOVE, _e_devicemgr_input_cb_mouse_move, NULL);
E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_MOUSE_WHEEL, _e_devicemgr_input_cb_mouse_wheel, NULL);
- E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_KEY_DOWN, _e_devicemgr_input_cb_key_down, NULL);
- E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_KEY_UP, _e_devicemgr_input_cb_key_up, NULL);
E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_DEVICE_ADD, _e_devicemgr_input_cb_device_add, NULL);
E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_DEVICE_DEL, _e_devicemgr_input_cb_device_del, NULL);
E_LIST_HANDLER_PREPEND(e_devicemgr->handlers, ECORE_EVENT_DEVICE_SUBCLASS_UPDATE, _e_devicemgr_input_cb_device_update, NULL);
void e_devicemgr_wl_device_del(E_Devicemgr_Input_Device *dev);
void e_devicemgr_wl_device_update(E_Devicemgr_Input_Device *dev);
-Eina_Bool e_devicemgr_block_check_keyboard(Ecore_Event_Key *ev, Eina_Bool pressed);
-Eina_Bool e_devicemgr_block_check_move(Ecore_Event_Mouse_Move *ev);
-Eina_Bool e_devicemgr_block_check_button(Ecore_Event_Mouse_Button *ev, Eina_Bool pressed);
void e_devicemgr_wl_block_send_expired(struct wl_resource *resource);
int e_devicemgr_block_add(struct wl_client *client, struct wl_resource *resource, uint32_t clas, uint32_t duration);
int e_devicemgr_block_remove(struct wl_client *client);
#define E_INPUT_TYPE (int)0xE0b0beaf
+#define E_INPUT_REQUEST_SERVER ((void *)0x1)
+
#include <xkbcommon/xkbcommon.h>
typedef enum _E_Input_Seat_Capabilities
struct xkb_context *xkb_ctx;
Ecore_Window window;
Eina_Bool left_handed : 1;
+
+ unsigned int blocked;
+ void *blocked_client;
+ unsigned int server_blocked;
};
EINTERN int e_input_init(Ecore_Evas *ee);
E_API unsigned int e_input_device_touch_pressed_get(E_Input_Device *dev);
E_API Eina_Bool e_input_device_keyboard_remap_set(E_Input_Device *dev, int *from_keys, int *to_keys, int num);
+EINTERN Eina_Bool e_input_device_block(E_Input_Device *dev, unsigned int type, void *client);
+EINTERN Eina_Bool e_input_device_unblock(E_Input_Device *dev, void *client);
+
+
#endif
#endif
return ret;
}
+
+EINTERN Eina_Bool
+e_input_device_block(E_Input_Device *dev, unsigned int type, void *client)
+{
+ E_Input_Seat *seat = NULL;
+ E_Input_Evdev *edev = NULL;
+ Eina_List *l = NULL, *l2 = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
+
+ if (client && client != E_INPUT_REQUEST_SERVER)
+ {
+ if (dev->blocked_client && (dev->blocked_client != client))
+ {
+ WRN("Already blocked by client: %p (type: 0x%x)\n", dev->blocked_client, dev->blocked);
+ return EINA_FALSE;
+ }
+
+ dev->blocked |= type;
+ dev->blocked_client = client;
+ }
+ else if (client == E_INPUT_REQUEST_SERVER)
+ {
+ dev->server_blocked = type;
+ }
+
+ if (type & E_INPUT_SEAT_TOUCH)
+ {
+ EINA_LIST_FOREACH(dev->seats, l, seat)
+ {
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ {
+ edev->touch.blocked = EINA_TRUE;
+ }
+ }
+ }
+
+ return EINA_TRUE;
+}
+
+EINTERN Eina_Bool
+e_input_device_unblock(E_Input_Device *dev, void *client)
+{
+ E_Input_Seat *seat = NULL;
+ E_Input_Evdev *edev = NULL;
+ Eina_List *l = NULL, *l2 = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
+
+ if (client != E_INPUT_REQUEST_SERVER && dev->blocked_client != client)
+ {
+ WRN("Currently %p client has already bloked (type: 0x%x)\n", dev->blocked_client, dev->blocked);
+ return EINA_FALSE;
+ }
+
+ if ((dev->server_blocked & E_INPUT_SEAT_TOUCH) ||
+ (dev->blocked & E_INPUT_SEAT_TOUCH))
+ {
+ EINA_LIST_FOREACH(dev->seats, l, seat)
+ {
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ {
+ if (edev->touch.raw_pressed == 0x0)
+ edev->touch.blocked = EINA_FALSE;
+ }
+ }
+ }
+
+ if (client == E_INPUT_REQUEST_SERVER)
+ {
+ dev->server_blocked = 0x0;
+ }
+ else
+ {
+ dev->blocked = 0x0;
+ dev->blocked_client = NULL;
+ }
+
+ return EINA_TRUE;
+}
\ No newline at end of file
char *tmp = NULL, *compose = NULL;
E_Keyrouter_Event_Data *key_data;
Ecore_Device *ecore_dev = NULL, *data;
- Eina_List *l;
+ Eina_List *l, *l_next;
E_Comp_Config *comp_conf = NULL;
+ int *pressed_keycode = NULL, *idata = NULL;
+ Eina_Bool dup_found = EINA_FALSE;
if (!(edev = libinput_device_get_user_data(device)))
{
state = libinput_event_keyboard_get_key_state(event);
key_count = libinput_event_keyboard_get_seat_key_count(event);
+ if (state == LIBINPUT_KEY_STATE_PRESSED)
+ {
+ if ((edev->seat->dev->blocked & E_INPUT_SEAT_KEYBOARD) ||
+ (edev->seat->dev->server_blocked & E_INPUT_SEAT_KEYBOARD))
+ {
+ ELOGF("Key", "Press (keycode: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
+ code, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client,
+ edev->seat->dev->server_blocked);
+ return;
+ }
+
+ /* FIXME: Currently to maintain press/release event pair during input block,
+ * used Eina_List and this is method used in devicemgr module.
+ * But we need to consider which way is better to maintain key press/release pair.
+ */
+
+ EINA_LIST_FOREACH(edev->xkb.pressed_keys, l, idata)
+ {
+ if (*idata == code)
+ {
+ dup_found = EINA_TRUE;
+ break;
+ }
+ }
+ if (!dup_found)
+ {
+ pressed_keycode = E_NEW(int, 1);
+ EINA_SAFETY_ON_NULL_RETURN(pressed_keycode);
+ *pressed_keycode = code;
+
+ edev->xkb.pressed_keys = eina_list_append(edev->xkb.pressed_keys, pressed_keycode);
+ }
+ }
+ else
+ {
+ dup_found = EINA_FALSE;
+ EINA_LIST_FOREACH_SAFE(edev->xkb.pressed_keys, l, l_next, idata)
+ {
+ if (code == *idata)
+ {
+ edev->xkb.pressed_keys = eina_list_remove_list(edev->xkb.pressed_keys, l);
+ E_FREE(idata);
+ dup_found = EINA_TRUE;
+ break;
+ }
+ }
+ if (!dup_found)
+ {
+ ELOGF("Key", "Release (keycode: %d, device: %s) is blocked by %p", NULL,
+ code, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client);
+ return;
+ }
+ }
+
/* ignore key events that are not seat wide state changes */
if (((state == LIBINPUT_KEY_STATE_PRESSED) && (key_count != 1)) ||
((state == LIBINPUT_KEY_STATE_RELEASED) && (key_count != 0)))
edev->seat->ptr.ix = edev->seat->ptr.dx;
edev->seat->ptr.iy = edev->seat->ptr.dy;
+ if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ {
+ return;
+ }
+
_device_pointer_motion(edev, event);
}
edev->seat->ptr.ix = edev->seat->ptr.dx;
edev->seat->ptr.iy = edev->seat->ptr.dy;
+
+ if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ {
+ return;
+ }
+
_device_pointer_motion(edev, event);
}
return;
}
- if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button))))
- {
- return;
- }
-
state = libinput_event_pointer_get_button_state(event);
button = libinput_event_pointer_get_button(event);
timestamp = libinput_event_pointer_get_time(event);
if (button == 3) button = 2;
else if (button == 2) button = 3;
+ if (state)
+ {
+ if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ {
+ ELOGF("Mouse", "Button Press (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
+ button, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client,
+ edev->seat->dev->server_blocked);
+ return;
+ }
+ else
+ {
+ edev->mouse.pressed_button |= (1 << button);
+ }
+ }
+ else
+ {
+ if (!(edev->mouse.pressed_button & (1 << button)))
+ {
+ ELOGF("Mouse", "Button Release (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
+ button, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client,
+ edev->seat->dev->server_blocked);
+ return;
+ }
+ edev->mouse.pressed_button &= ~(1 << button);
+ }
+
+ if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button))))
+ {
+ return;
+ }
+
ev->window = (Ecore_Window)input->dev->window;
ev->event_window = (Ecore_Window)input->dev->window;
ev->root_window = (Ecore_Window)input->dev->window;
Ecore_Device *ecore_dev = NULL, *detent_data = NULL, *data;
Eina_List *l;
E_Comp_Config *comp_conf = NULL;
+ int direction = 0, z = 0;
if (!(edev = libinput_device_get_user_data(device)))
{
return;
}
+ axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
+ if (libinput_event_pointer_has_axis(event, axis))
+ z = libinput_event_pointer_get_axis_value(event, axis);
+
+ axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
+ if (libinput_event_pointer_has_axis(event, axis))
+ {
+ direction = 1;
+ z = libinput_event_pointer_get_axis_value(event, axis);
+ }
+
+ if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ {
+ if (detent_data)
+ ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
+ direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
+ else
+ ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
+ direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
+ return;
+ }
+
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel))))
{
return;
ev->root.y = ev->y;
ev->dev = ecore_device_ref(ecore_dev);
- axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
- if (libinput_event_pointer_has_axis(event, axis))
- ev->z = libinput_event_pointer_get_axis_value(event, axis);
-
- axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
- if (libinput_event_pointer_has_axis(event, axis))
- {
- ev->direction = 1;
- ev->z = libinput_event_pointer_get_axis_value(event, axis);
- }
+ ev->z = z;
+ ev->direction = direction;
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Touch", "Down (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ edev->touch.raw_pressed |= (1 << edev->mt_slot);
+
+ if (edev->touch.blocked)
+ {
+ ELOGF("Touch", "Down (id: %d, x: %d, y: %d) is blocked by %p, server: 0x%x", NULL,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, edev->seat->dev->blocked_client,
+ edev->seat->dev->server_blocked);
+ return;
+ }
+
_device_handle_touch_motion_send(edev, event);
_device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN);
}
edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy;
}
+ if (!(edev->touch.pressed & (1 << edev->mt_slot)))
+ {
+ if (edev->touch.blocked)
+ {
+ return;
+ }
+ }
+
_device_handle_touch_motion_send(edev, event);
}
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Touch", "Up (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ edev->touch.raw_pressed &= ~(1 << edev->mt_slot);
+
+ if (edev->touch.blocked)
+ {
+ if (!(edev->touch.pressed & (1 << edev->mt_slot)))
+ {
+ ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked by %p, server(0x%x)", NULL,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, edev->seat->dev->blocked_client,
+ edev->seat->dev->server_blocked);
+ if (edev->touch.raw_pressed == 0x0)
+ {
+ edev->touch.blocked = EINA_FALSE;
+ }
+ return;
+ }
+ }
+
_device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP);
}
/* add this new seat to list */
input->dev->seats = eina_list_append(input->dev->seats, s);
+ s->dev = input->dev;
ecore_event_add(E_INPUT_EVENT_SEAT_ADD, NULL, NULL, NULL);
{
const char *name;
E_Input_Backend *input;
+ E_Input_Device *dev;
Eina_List *devices;
struct libinput_seat *seat;
Ecore_Device *ecore_dev;
Eina_Bool did_double : 1;
Eina_Bool did_triple : 1;
uint32_t prev_button, last_button;
+ unsigned int pressed_button;
} mouse;
struct
xkb_mod_mask_t altgr_mask;
unsigned int modifiers;
unsigned int depressed, latched, locked, group;
+
+ Eina_List *pressed_keys;
} xkb;
Eina_Hash *key_remap_hash;
} coords[E_INPUT_MAX_SLOTS];
unsigned int pressed;
+ unsigned int raw_pressed;
+ Eina_Bool blocked;
} touch;
};