forked from enlightenment/efl
ecore/wayland: Report correctly the device which emitted the mouse event.
This commit is contained in:
parent
0632415e9c
commit
c18e76eb2c
|
@ -38,7 +38,7 @@
|
|||
typedef struct _Ecore_Wl_Mouse_Down_Info
|
||||
{
|
||||
EINA_INLIST;
|
||||
void *dev;
|
||||
int dev;
|
||||
int last_win;
|
||||
int last_last_win;
|
||||
int last_event_win;
|
||||
|
@ -61,7 +61,7 @@ static void _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat
|
|||
static void _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy);
|
||||
static void _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface);
|
||||
static void _ecore_wl_input_cb_pointer_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, wl_fixed_t sx, wl_fixed_t sy);
|
||||
static void _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state);
|
||||
static void _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state);
|
||||
static void _ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, unsigned int axis, wl_fixed_t value);
|
||||
static void _ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED);
|
||||
static void _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size);
|
||||
|
@ -72,7 +72,7 @@ static void _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard
|
|||
static Eina_Bool _ecore_wl_input_cb_keyboard_repeat(void *data, Ecore_Fd_Handler *handler EINA_UNUSED);
|
||||
static void _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch, unsigned int serial, unsigned int timestamp, struct wl_surface *surface EINA_UNUSED, int id EINA_UNUSED, wl_fixed_t x, wl_fixed_t y);
|
||||
static void _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch, unsigned int serial, unsigned int timestamp, int id EINA_UNUSED);
|
||||
static void _ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id EINA_UNUSED, wl_fixed_t x, wl_fixed_t y);
|
||||
static void _ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id, wl_fixed_t x, wl_fixed_t y);
|
||||
static void _ecore_wl_input_cb_touch_frame(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED);
|
||||
static void _ecore_wl_input_cb_touch_cancel(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED);
|
||||
static void _ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer);
|
||||
|
@ -82,15 +82,15 @@ static void _ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *da
|
|||
static void _ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device);
|
||||
static void _ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer);
|
||||
|
||||
static void _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp, int device);
|
||||
static void _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp);
|
||||
static void _ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp);
|
||||
static void _ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, void *device, unsigned int button, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, void *device, unsigned int button, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp);
|
||||
static Ecore_Wl_Mouse_Down_Info *_ecore_wl_mouse_down_info_get(void *dev);
|
||||
static Ecore_Wl_Mouse_Down_Info *_ecore_wl_mouse_down_info_get(int dev);
|
||||
|
||||
/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */
|
||||
|
||||
|
@ -440,11 +440,11 @@ _ecore_wl_input_cb_pointer_motion(void *data, struct wl_pointer *pointer EINA_UN
|
|||
input->timestamp = timestamp;
|
||||
|
||||
if (input->pointer_focus)
|
||||
_ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp);
|
||||
_ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state)
|
||||
_ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state)
|
||||
{
|
||||
Ecore_Wl_Input *input;
|
||||
|
||||
|
@ -463,12 +463,12 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer, unsign
|
|||
ecore_wl_input_grab(input, input->pointer_focus, button);
|
||||
|
||||
_ecore_wl_input_mouse_down_send(input, input->pointer_focus,
|
||||
pointer, button, timestamp);
|
||||
0, button, timestamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ecore_wl_input_mouse_up_send(input, input->pointer_focus,
|
||||
pointer, button, timestamp);
|
||||
0, button, timestamp);
|
||||
if ((input->grab) && (input->grab_button == button) && (!state))
|
||||
ecore_wl_input_ungrab(input);
|
||||
}
|
||||
|
@ -727,7 +727,7 @@ _ecore_wl_input_cb_keyboard_repeat(void *data, Ecore_Fd_Handler *handler EINA_UN
|
|||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer, unsigned int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy)
|
||||
_ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy)
|
||||
{
|
||||
Ecore_Wl_Input *input;
|
||||
Ecore_Wl_Window *win = NULL;
|
||||
|
@ -773,7 +773,7 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer, unsigne
|
|||
{
|
||||
/* NB: 'Fake' a mouse_up for move finished */
|
||||
win->moving = EINA_FALSE;
|
||||
_ecore_wl_input_mouse_up_send(input, win, pointer,
|
||||
_ecore_wl_input_mouse_up_send(input, win, 0,
|
||||
BTN_LEFT, input->timestamp);
|
||||
|
||||
if ((input->grab) && (input->grab_button == BTN_LEFT))
|
||||
|
@ -783,7 +783,7 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer, unsigne
|
|||
{
|
||||
/* NB: 'Fake' a mouse_up for resize finished */
|
||||
win->resizing = EINA_FALSE;
|
||||
_ecore_wl_input_mouse_up_send(input, win, pointer,
|
||||
_ecore_wl_input_mouse_up_send(input, win, 0,
|
||||
BTN_LEFT, input->timestamp);
|
||||
|
||||
if ((input->grab) && (input->grab_button == BTN_LEFT))
|
||||
|
@ -895,7 +895,7 @@ _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_
|
|||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch, unsigned int serial, unsigned int timestamp, struct wl_surface *surface EINA_UNUSED, int id EINA_UNUSED, wl_fixed_t x, wl_fixed_t y)
|
||||
_ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, struct wl_surface *surface EINA_UNUSED, int id, wl_fixed_t x, wl_fixed_t y)
|
||||
{
|
||||
Ecore_Wl_Input *input;
|
||||
|
||||
|
@ -912,11 +912,11 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch, unsigned int s
|
|||
input->sy = wl_fixed_to_int(y);
|
||||
_ecore_wl_input_cb_pointer_enter(data, NULL, serial, surface, x, y);
|
||||
_ecore_wl_input_mouse_down_send(input, input->pointer_focus,
|
||||
touch, BTN_LEFT, timestamp);
|
||||
id, BTN_LEFT, timestamp);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch, unsigned int serial, unsigned int timestamp, int id EINA_UNUSED)
|
||||
_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id)
|
||||
{
|
||||
Ecore_Wl_Input *input;
|
||||
|
||||
|
@ -929,11 +929,11 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch, unsigned int ser
|
|||
/* input->timestamp = timestamp; */
|
||||
input->display->serial = serial;
|
||||
_ecore_wl_input_mouse_up_send(input, input->pointer_focus,
|
||||
touch, BTN_LEFT, timestamp);
|
||||
id, BTN_LEFT, timestamp);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id EINA_UNUSED, wl_fixed_t x, wl_fixed_t y)
|
||||
_ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id, wl_fixed_t x, wl_fixed_t y)
|
||||
{
|
||||
Ecore_Wl_Input *input;
|
||||
|
||||
|
@ -947,7 +947,7 @@ _ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED,
|
|||
input->sx = wl_fixed_to_int(x);
|
||||
input->sy = wl_fixed_to_int(y);
|
||||
|
||||
_ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp);
|
||||
_ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1013,7 +1013,7 @@ _ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device
|
|||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp)
|
||||
_ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp, int device)
|
||||
{
|
||||
Ecore_Event_Mouse_Move *ev;
|
||||
|
||||
|
@ -1027,7 +1027,7 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
|
|||
/* ev->root.x = input->sx; */
|
||||
/* ev->root.y = input->sy; */
|
||||
ev->modifiers = input->modifiers;
|
||||
ev->multi.device = 0;
|
||||
ev->multi.device = device;
|
||||
ev->multi.radius = 1;
|
||||
ev->multi.radius_x = 1;
|
||||
ev->multi.radius_y = 1;
|
||||
|
@ -1122,7 +1122,7 @@ _ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Windo
|
|||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, void *device, unsigned int button, unsigned int timestamp)
|
||||
_ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev;
|
||||
Ecore_Wl_Mouse_Down_Info *down_info;
|
||||
|
@ -1196,7 +1196,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, voi
|
|||
}
|
||||
}
|
||||
|
||||
ev->multi.device = 0;
|
||||
ev->multi.device = device;
|
||||
ev->multi.radius = 1;
|
||||
ev->multi.radius_x = 1;
|
||||
ev->multi.radius_y = 1;
|
||||
|
@ -1226,7 +1226,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, voi
|
|||
}
|
||||
|
||||
static void
|
||||
_ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, void *device, unsigned int button, unsigned int timestamp)
|
||||
_ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp)
|
||||
{
|
||||
Ecore_Event_Mouse_Button *ev;
|
||||
Ecore_Wl_Mouse_Down_Info *down_info;
|
||||
|
@ -1262,7 +1262,7 @@ _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, void
|
|||
ev->triple_click = 1;
|
||||
}
|
||||
|
||||
ev->multi.device = 0;
|
||||
ev->multi.device = device;
|
||||
ev->multi.radius = 1;
|
||||
ev->multi.radius_x = 1;
|
||||
ev->multi.radius_y = 1;
|
||||
|
@ -1344,7 +1344,7 @@ _ecore_wl_mouse_down_info_clear(void)
|
|||
}
|
||||
|
||||
static Ecore_Wl_Mouse_Down_Info *
|
||||
_ecore_wl_mouse_down_info_get(void *dev)
|
||||
_ecore_wl_mouse_down_info_get(int dev)
|
||||
{
|
||||
Eina_Inlist *l = NULL;
|
||||
Ecore_Wl_Mouse_Down_Info *info = NULL;
|
||||
|
|
Loading…
Reference in New Issue