summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhyuni.kang <jhyuni.kang@samsung.com>2015-05-18 13:04:37 +0900
committerjhyuni.kang <jhyuni.kang@samsung.com>2015-05-18 15:06:09 +0900
commit33c12d621cc97c7c46fde568a06e0122342ab78a (patch)
tree6b0f821a9ad4a1820fb44f464895ea3c98597e36
parent5550b595c913465951042bbe68a2f01c2543bdf3 (diff)
ecore-wayland: Add a grab_count variable for synchronization wl_input_grab/ungrab with pointer and touch event
Change-Id: I06fdcc2ced0108b306a9079a6016804e4ce15f07
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c188
-rw-r--r--src/lib/ecore_wayland/ecore_wl_private.h1
2 files changed, 100 insertions, 89 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index 95ee001737..a612fd84b2 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -4,7 +4,7 @@
4 4
5/* 5/*
6 * NB: Events that receive a 'serial' instead of timestamp 6 * NB: Events that receive a 'serial' instead of timestamp
7 * 7 *
8 * input_device_attach (for pointer image) 8 * input_device_attach (for pointer image)
9 * input_device_button_event (button press/release) 9 * input_device_button_event (button press/release)
10 * input_device_key_press 10 * input_device_key_press
@@ -14,14 +14,14 @@
14 * input_device_keyboard_leave 14 * input_device_keyboard_leave
15 * input_device_touch_down 15 * input_device_touch_down
16 * input_device_touch_up 16 * input_device_touch_up
17 * 17 *
18 **/ 18 **/
19 19
20#include "ecore_wl_private.h" 20#include "ecore_wl_private.h"
21#include <sys/mman.h> 21#include <sys/mman.h>
22#include <ctype.h> 22#include <ctype.h>
23 23
24/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ... 24/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ...
25 * What about other OSs ?? */ 25 * What about other OSs ?? */
26#ifdef __linux__ 26#ifdef __linux__
27# include <linux/input.h> 27# include <linux/input.h>
@@ -94,7 +94,7 @@ static Ecore_Wl_Mouse_Down_Info *_ecore_wl_mouse_down_info_get(int dev);
94/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */ 94/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */
95 95
96/* wayland interfaces */ 96/* wayland interfaces */
97static const struct wl_pointer_listener pointer_listener = 97static const struct wl_pointer_listener pointer_listener =
98{ 98{
99 _ecore_wl_input_cb_pointer_enter, 99 _ecore_wl_input_cb_pointer_enter,
100 _ecore_wl_input_cb_pointer_leave, 100 _ecore_wl_input_cb_pointer_leave,
@@ -103,7 +103,7 @@ static const struct wl_pointer_listener pointer_listener =
103 _ecore_wl_input_cb_pointer_axis, 103 _ecore_wl_input_cb_pointer_axis,
104}; 104};
105 105
106static const struct wl_keyboard_listener keyboard_listener = 106static const struct wl_keyboard_listener keyboard_listener =
107{ 107{
108 _ecore_wl_input_cb_keyboard_keymap, 108 _ecore_wl_input_cb_keyboard_keymap,
109 _ecore_wl_input_cb_keyboard_enter, 109 _ecore_wl_input_cb_keyboard_enter,
@@ -112,7 +112,7 @@ static const struct wl_keyboard_listener keyboard_listener =
112 _ecore_wl_input_cb_keyboard_modifiers, 112 _ecore_wl_input_cb_keyboard_modifiers,
113}; 113};
114 114
115static const struct wl_touch_listener touch_listener = 115static const struct wl_touch_listener touch_listener =
116{ 116{
117 _ecore_wl_input_cb_touch_down, 117 _ecore_wl_input_cb_touch_down,
118 _ecore_wl_input_cb_touch_up, 118 _ecore_wl_input_cb_touch_up,
@@ -121,13 +121,13 @@ static const struct wl_touch_listener touch_listener =
121 _ecore_wl_input_cb_touch_cancel 121 _ecore_wl_input_cb_touch_cancel
122}; 122};
123 123
124static const struct wl_seat_listener _ecore_wl_seat_listener = 124static const struct wl_seat_listener _ecore_wl_seat_listener =
125{ 125{
126 _ecore_wl_input_seat_handle_capabilities, 126 _ecore_wl_input_seat_handle_capabilities,
127 NULL // _ecore_wl_input_seat_handle_name 127 NULL // _ecore_wl_input_seat_handle_name
128}; 128};
129 129
130static const struct wl_data_device_listener _ecore_wl_data_listener = 130static const struct wl_data_device_listener _ecore_wl_data_listener =
131{ 131{
132 _ecore_wl_input_cb_data_offer, 132 _ecore_wl_input_cb_data_offer,
133 _ecore_wl_input_cb_data_enter, 133 _ecore_wl_input_cb_data_enter,
@@ -137,7 +137,7 @@ static const struct wl_data_device_listener _ecore_wl_data_listener =
137 _ecore_wl_input_cb_data_selection 137 _ecore_wl_input_cb_data_selection
138}; 138};
139 139
140static const struct wl_callback_listener _ecore_wl_pointer_surface_listener = 140static const struct wl_callback_listener _ecore_wl_pointer_surface_listener =
141{ 141{
142 _ecore_wl_input_cb_pointer_frame 142 _ecore_wl_input_cb_pointer_frame
143}; 143};
@@ -145,7 +145,7 @@ static const struct wl_callback_listener _ecore_wl_pointer_surface_listener =
145/* local variables */ 145/* local variables */
146static int _pointer_x, _pointer_y; 146static int _pointer_x, _pointer_y;
147 147
148EAPI void 148EAPI void
149ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button) 149ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button)
150{ 150{
151 LOGFN(__FILE__, __LINE__, __FUNCTION__); 151 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -155,7 +155,7 @@ ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int bu
155 input->grab_button = button; 155 input->grab_button = button;
156} 156}
157 157
158EAPI void 158EAPI void
159ecore_wl_input_ungrab(Ecore_Wl_Input *input) 159ecore_wl_input_ungrab(Ecore_Wl_Input *input)
160{ 160{
161 LOGFN(__FILE__, __LINE__, __FUNCTION__); 161 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -163,7 +163,7 @@ ecore_wl_input_ungrab(Ecore_Wl_Input *input)
163 if (!input) return; 163 if (!input) return;
164 164
165 if ((input->grab) && (input->grab_button)) 165 if ((input->grab) && (input->grab_button))
166 _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, 166 _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button,
167 input->grab_timestamp); 167 input->grab_timestamp);
168 168
169 input->grab = NULL; 169 input->grab = NULL;
@@ -222,7 +222,7 @@ ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size)
222 222
223 EINA_SAFETY_ON_NULL_RETURN(input->display->wl.shm); 223 EINA_SAFETY_ON_NULL_RETURN(input->display->wl.shm);
224 224
225 input->display->cursor_theme = 225 input->display->cursor_theme =
226 wl_cursor_theme_load(NULL, input->cursor_size, input->display->wl.shm); 226 wl_cursor_theme_load(NULL, input->cursor_size, input->display->wl.shm);
227} 227}
228 228
@@ -298,7 +298,7 @@ ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char *cursor_na
298 eina_stringshare_replace(&input->cursor_name, cursor_name); 298 eina_stringshare_replace(&input->cursor_name, cursor_name);
299 299
300 /* No cursor. Set to default Left Pointer */ 300 /* No cursor. Set to default Left Pointer */
301 if (!cursor_name) 301 if (!cursor_name)
302 eina_stringshare_replace(&input->cursor_name, "left_ptr"); 302 eina_stringshare_replace(&input->cursor_name, "left_ptr");
303 303
304 /* try to get this cursor from the theme */ 304 /* try to get this cursor from the theme */
@@ -356,7 +356,7 @@ ecore_wl_input_seat_get(Ecore_Wl_Input *input)
356} 356}
357 357
358/* local functions */ 358/* local functions */
359void 359void
360_ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id) 360_ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
361{ 361{
362 Ecore_Wl_Input *input; 362 Ecore_Wl_Input *input;
@@ -385,11 +385,11 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
385 cursor_theme_name = getenv("ECORE_WL_CURSOR_THEME_NAME"); 385 cursor_theme_name = getenv("ECORE_WL_CURSOR_THEME_NAME");
386 ecore_wl_input_cursor_theme_name_set(input, cursor_theme_name); 386 ecore_wl_input_cursor_theme_name_set(input, cursor_theme_name);
387 387
388 input->seat = 388 input->seat =
389 wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1); 389 wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1);
390 ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input)); 390 ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input));
391 391
392 wl_seat_add_listener(input->seat, 392 wl_seat_add_listener(input->seat,
393 &_ecore_wl_seat_listener, input); 393 &_ecore_wl_seat_listener, input);
394 wl_seat_set_user_data(input->seat, input); 394 wl_seat_set_user_data(input->seat, input);
395 395
@@ -397,17 +397,17 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
397 397
398 if (ewd->wl.data_device_manager) 398 if (ewd->wl.data_device_manager)
399 { 399 {
400 input->data_device = 400 input->data_device =
401 wl_data_device_manager_get_data_device(ewd->wl.data_device_manager, 401 wl_data_device_manager_get_data_device(ewd->wl.data_device_manager,
402 input->seat); 402 input->seat);
403 wl_data_device_add_listener(input->data_device, 403 wl_data_device_add_listener(input->data_device,
404 &_ecore_wl_data_listener, input); 404 &_ecore_wl_data_listener, input);
405 } 405 }
406 406
407 ewd->input = input; 407 ewd->input = input;
408} 408}
409 409
410void 410void
411_ecore_wl_input_del(Ecore_Wl_Input *input) 411_ecore_wl_input_del(Ecore_Wl_Input *input)
412{ 412{
413 if (!input) return; 413 if (!input) return;
@@ -480,14 +480,14 @@ _ecore_wl_input_del(Ecore_Wl_Input *input)
480 free(input); 480 free(input);
481} 481}
482 482
483void 483void
484_ecore_wl_input_pointer_xy_get(int *x, int *y) 484_ecore_wl_input_pointer_xy_get(int *x, int *y)
485{ 485{
486 if (x) *x = _pointer_x; 486 if (x) *x = _pointer_x;
487 if (y) *y = _pointer_y; 487 if (y) *y = _pointer_y;
488} 488}
489 489
490static void 490static void
491_ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) 491_ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps)
492{ 492{
493 Ecore_Wl_Input *input; 493 Ecore_Wl_Input *input;
@@ -504,7 +504,7 @@ _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum
504 504
505 if (!input->cursor_surface) 505 if (!input->cursor_surface)
506 { 506 {
507 input->cursor_surface = 507 input->cursor_surface =
508 wl_compositor_create_surface(_ecore_wl_disp->wl.compositor); 508 wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
509 } 509 }
510 } 510 }
@@ -541,7 +541,7 @@ _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum
541 } 541 }
542} 542}
543 543
544static void 544static void
545_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) 545_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)
546{ 546{
547 Ecore_Wl_Input *input; 547 Ecore_Wl_Input *input;
@@ -559,7 +559,7 @@ _ecore_wl_input_cb_pointer_motion(void *data, struct wl_pointer *pointer EINA_UN
559 _ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, 0); 559 _ecore_wl_input_mouse_move_send(input, input->pointer_focus, timestamp, 0);
560} 560}
561 561
562static void 562static void
563_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) 563_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)
564{ 564{
565 Ecore_Wl_Input *input; 565 Ecore_Wl_Input *input;
@@ -575,7 +575,7 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN
575 575
576 if (state) 576 if (state)
577 { 577 {
578 if ((input->pointer_focus) && (!input->grab)) 578 if ((input->pointer_focus) && (!input->grab) && (!input->grab_count))
579 { 579 {
580 ecore_wl_input_grab(input, input->pointer_focus, button); 580 ecore_wl_input_grab(input, input->pointer_focus, button);
581 input->grab_timestamp = timestamp; 581 input->grab_timestamp = timestamp;
@@ -584,6 +584,7 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN
584 if (input->pointer_focus) 584 if (input->pointer_focus)
585 _ecore_wl_input_mouse_down_send(input, input->pointer_focus, 585 _ecore_wl_input_mouse_down_send(input, input->pointer_focus,
586 0, button, timestamp); 586 0, button, timestamp);
587 input->grab_count++;
587 } 588 }
588 else 589 else
589 { 590 {
@@ -591,14 +592,16 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN
591 _ecore_wl_input_mouse_up_send(input, input->pointer_focus, 592 _ecore_wl_input_mouse_up_send(input, input->pointer_focus,
592 0, button, timestamp); 593 0, button, timestamp);
593 594
594 if ((input->grab) && (input->grab_button == button) && (!state)) 595 input->grab_count--;
596 if ((input->grab) && (input->grab_button == button) &&
597 (!state) && (!input->grab_count))
595 ecore_wl_input_ungrab(input); 598 ecore_wl_input_ungrab(input);
596 } 599 }
597 600
598// _ecore_wl_input_mouse_move_send(input, timestamp); 601// _ecore_wl_input_mouse_move_send(input, timestamp);
599} 602}
600 603
601static void 604static void
602_ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, unsigned int axis, wl_fixed_t value) 605_ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, unsigned int axis, wl_fixed_t value)
603{ 606{
604 Ecore_Wl_Input *input; 607 Ecore_Wl_Input *input;
@@ -606,11 +609,11 @@ _ecore_wl_input_cb_pointer_axis(void *data, struct wl_pointer *pointer EINA_UNUS
606 LOGFN(__FILE__, __LINE__, __FUNCTION__); 609 LOGFN(__FILE__, __LINE__, __FUNCTION__);
607 610
608 if (!(input = data)) return; 611 if (!(input = data)) return;
609 _ecore_wl_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value), 612 _ecore_wl_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value),
610 timestamp); 613 timestamp);
611} 614}
612 615
613static void 616static void
614_ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED) 617_ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsigned int timestamp EINA_UNUSED)
615{ 618{
616 Ecore_Wl_Input *input; 619 Ecore_Wl_Input *input;
@@ -635,12 +638,12 @@ _ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsig
635 if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb)) 638 if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb))
636 { 639 {
637 input->cursor_frame_cb = wl_surface_frame(input->cursor_surface); 640 input->cursor_frame_cb = wl_surface_frame(input->cursor_surface);
638 wl_callback_add_listener(input->cursor_frame_cb, 641 wl_callback_add_listener(input->cursor_frame_cb,
639 &_ecore_wl_pointer_surface_listener, input); 642 &_ecore_wl_pointer_surface_listener, input);
640 } 643 }
641} 644}
642 645
643static void 646static void
644_ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size) 647_ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int format, int fd, unsigned int size)
645{ 648{
646 Ecore_Wl_Input *input; 649 Ecore_Wl_Input *input;
@@ -667,8 +670,8 @@ _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA
667 return; 670 return;
668 } 671 }
669 672
670 input->xkb.keymap = 673 input->xkb.keymap =
671 xkb_map_new_from_string(input->display->xkb.context, map, 674 xkb_map_new_from_string(input->display->xkb.context, map,
672 XKB_KEYMAP_FORMAT_TEXT_V1, 0); 675 XKB_KEYMAP_FORMAT_TEXT_V1, 0);
673 676
674 munmap(map, size); 677 munmap(map, size);
@@ -682,21 +685,21 @@ _ecore_wl_input_cb_keyboard_keymap(void *data, struct wl_keyboard *keyboard EINA
682 return; 685 return;
683 } 686 }
684 687
685 input->xkb.control_mask = 688 input->xkb.control_mask =
686 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CTRL); 689 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CTRL);
687 input->xkb.alt_mask = 690 input->xkb.alt_mask =
688 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_ALT); 691 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_ALT);
689 input->xkb.shift_mask = 692 input->xkb.shift_mask =
690 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_SHIFT); 693 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_SHIFT);
691 input->xkb.win_mask = 694 input->xkb.win_mask =
692 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_LOGO); 695 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_LOGO);
693 input->xkb.scroll_mask = 696 input->xkb.scroll_mask =
694 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_SCROLL); 697 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_SCROLL);
695 input->xkb.num_mask = 698 input->xkb.num_mask =
696 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_NUM); 699 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_LED_NAME_NUM);
697 input->xkb.caps_mask = 700 input->xkb.caps_mask =
698 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CAPS); 701 1 << xkb_map_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_CAPS);
699 input->xkb.altgr_mask = 702 input->xkb.altgr_mask =
700 1 << xkb_map_mod_get_index(input->xkb.keymap, "ISO_Level3_Shift"); 703 1 << xkb_map_mod_get_index(input->xkb.keymap, "ISO_Level3_Shift");
701} 704}
702 705
@@ -744,7 +747,7 @@ _ecore_wl_input_keymap_translate_keysym(xkb_keysym_t keysym, unsigned int modifi
744 return 1; 747 return 1;
745} 748}
746 749
747static void 750static void
748_ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state) 751_ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state)
749{ 752{
750 Ecore_Wl_Input *input; 753 Ecore_Wl_Input *input;
@@ -760,7 +763,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
760 if (!(input = data)) return; 763 if (!(input = data)) return;
761 764
762 win = input->keyboard_focus; 765 win = input->keyboard_focus;
763 if ((!win) || (win->keyboard_device != input) || (!input->xkb.state)) 766 if ((!win) || (win->keyboard_device != input) || (!input->xkb.state))
764 return; 767 return;
765 768
766 input->display->serial = serial; 769 input->display->serial = serial;
@@ -783,8 +786,8 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
783 snprintf(keyname, sizeof(keyname), "Keycode-%u", code); 786 snprintf(keyname, sizeof(keyname), "Keycode-%u", code);
784 787
785 /* if shift is active, we need to transform the key to lower */ 788 /* if shift is active, we need to transform the key to lower */
786 if (xkb_state_mod_index_is_active(input->xkb.state, 789 if (xkb_state_mod_index_is_active(input->xkb.state,
787 xkb_map_mod_get_index(input->xkb.keymap, 790 xkb_map_mod_get_index(input->xkb.keymap,
788 XKB_MOD_NAME_SHIFT), 791 XKB_MOD_NAME_SHIFT),
789 XKB_STATE_MODS_EFFECTIVE)) 792 XKB_STATE_MODS_EFFECTIVE))
790 { 793 {
@@ -793,7 +796,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
793 } 796 }
794 797
795 memset(compose, 0, sizeof(compose)); 798 memset(compose, 0, sizeof(compose));
796 _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers, 799 _ecore_wl_input_keymap_translate_keysym(sym, input->modifiers,
797 compose, sizeof(compose)); 800 compose, sizeof(compose));
798 801
799 e = malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) + 802 e = malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
@@ -838,14 +841,14 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
838 841
839 if (!input->repeat.tmr) 842 if (!input->repeat.tmr)
840 { 843 {
841 input->repeat.tmr = 844 input->repeat.tmr =
842 ecore_timer_add(0.025, _ecore_wl_input_cb_keyboard_repeat, input); 845 ecore_timer_add(0.025, _ecore_wl_input_cb_keyboard_repeat, input);
843 } 846 }
844 ecore_timer_delay(input->repeat.tmr, 0.4); 847 ecore_timer_delay(input->repeat.tmr, 0.4);
845 } 848 }
846} 849}
847 850
848static void 851static void
849_ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial EINA_UNUSED, unsigned int depressed, unsigned int latched, unsigned int locked, unsigned int group) 852_ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial EINA_UNUSED, unsigned int depressed, unsigned int latched, unsigned int locked, unsigned int group)
850{ 853{
851 Ecore_Wl_Input *input; 854 Ecore_Wl_Input *input;
@@ -857,10 +860,10 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E
857 860
858 if (!input->xkb.keymap) return; 861 if (!input->xkb.keymap) return;
859 862
860 xkb_state_update_mask(input->xkb.state, 863 xkb_state_update_mask(input->xkb.state,
861 depressed, latched, locked, 0, 0, group); 864 depressed, latched, locked, 0, 0, group);
862 865
863 mask = xkb_state_serialize_mods(input->xkb.state, 866 mask = xkb_state_serialize_mods(input->xkb.state,
864 (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED)); 867 (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED));
865 868
866 input->modifiers = 0; 869 input->modifiers = 0;
@@ -882,7 +885,7 @@ _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard E
882 input->modifiers |= ECORE_EVENT_MODIFIER_ALTGR; 885 input->modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
883} 886}
884 887
885static Eina_Bool 888static Eina_Bool
886_ecore_wl_input_cb_keyboard_repeat(void *data) 889_ecore_wl_input_cb_keyboard_repeat(void *data)
887{ 890{
888 Ecore_Wl_Input *input; 891 Ecore_Wl_Input *input;
@@ -893,14 +896,14 @@ _ecore_wl_input_cb_keyboard_repeat(void *data)
893 if (!(input = data)) return ECORE_CALLBACK_RENEW; 896 if (!(input = data)) return ECORE_CALLBACK_RENEW;
894 897
895 if ((win = input->keyboard_focus)) 898 if ((win = input->keyboard_focus))
896 _ecore_wl_input_cb_keyboard_key(input, NULL, input->display->serial, 899 _ecore_wl_input_cb_keyboard_key(input, NULL, input->display->serial,
897 input->repeat.time, 900 input->repeat.time,
898 input->repeat.key, EINA_TRUE); 901 input->repeat.key, EINA_TRUE);
899 902
900 return ECORE_CALLBACK_RENEW; 903 return ECORE_CALLBACK_RENEW;
901} 904}
902 905
903static void 906static void
904_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) 907_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)
905{ 908{
906 Ecore_Wl_Input *input; 909 Ecore_Wl_Input *input;
@@ -935,10 +938,10 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU
935 938
936 if (win->pointer.set) 939 if (win->pointer.set)
937 { 940 {
938 ecore_wl_input_pointer_set(input, win->pointer.surface, 941 ecore_wl_input_pointer_set(input, win->pointer.surface,
939 win->pointer.hot_x, win->pointer.hot_y); 942 win->pointer.hot_x, win->pointer.hot_y);
940 } 943 }
941 /* NB: Commented out for now. Not needed in most circumstances, 944 /* NB: Commented out for now. Not needed in most circumstances,
942 * but left here for any corner-cases */ 945 * but left here for any corner-cases */
943 /* else */ 946 /* else */
944 /* { */ 947 /* { */
@@ -949,7 +952,7 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU
949 } 952 }
950} 953}
951 954
952static void 955static void
953_ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface) 956_ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface)
954{ 957{
955 Ecore_Wl_Input *input; 958 Ecore_Wl_Input *input;
@@ -962,7 +965,7 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU
962 965
963 input->display->serial = serial; 966 input->display->serial = serial;
964 967
965 /* NB: Commented out for now. Not needed in most circumstances, but left 968 /* NB: Commented out for now. Not needed in most circumstances, but left
966 * here for any corner-cases */ 969 * here for any corner-cases */
967 /* _ecore_wl_input_cursor_update(input); */ 970 /* _ecore_wl_input_cursor_update(input); */
968 971
@@ -983,7 +986,7 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer EINA_UNU
983 } 986 }
984} 987}
985 988
986static void 989static void
987_ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface, struct wl_array *keys EINA_UNUSED) 990_ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface, struct wl_array *keys EINA_UNUSED)
988{ 991{
989 Ecore_Wl_Input *input; 992 Ecore_Wl_Input *input;
@@ -1012,7 +1015,7 @@ _ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard EINA_
1012 _ecore_wl_input_focus_in_send(input, win, input->timestamp); 1015 _ecore_wl_input_focus_in_send(input, win, input->timestamp);
1013} 1016}
1014 1017
1015static void 1018static void
1016_ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface) 1019_ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface)
1017{ 1020{
1018 Ecore_Wl_Input *input; 1021 Ecore_Wl_Input *input;
@@ -1045,7 +1048,7 @@ _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard EINA_
1045 input->keyboard_focus = NULL; 1048 input->keyboard_focus = NULL;
1046} 1049}
1047 1050
1048static void 1051static void
1049_ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, struct wl_surface *surface, int id, wl_fixed_t x, wl_fixed_t y) 1052_ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, struct wl_surface *surface, int id, wl_fixed_t x, wl_fixed_t y)
1050{ 1053{
1051 Ecore_Wl_Input *input; 1054 Ecore_Wl_Input *input;
@@ -1064,19 +1067,24 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, un
1064 input->sx = wl_fixed_to_int(x); 1067 input->sx = wl_fixed_to_int(x);
1065 input->sy = wl_fixed_to_int(y); 1068 input->sy = wl_fixed_to_int(y);
1066 1069
1067 _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id); 1070 //_ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
1068 _ecore_wl_input_cb_pointer_enter(data, NULL, serial, surface, x, y); 1071 if (!input->grab_count)
1069 if ((input->touch_focus) && (!input->grab))
1070 { 1072 {
1071 ecore_wl_input_grab(input, input->touch_focus, BTN_LEFT); 1073 _ecore_wl_input_cb_pointer_enter(data, NULL, serial, surface, x, y);
1072 input->grab_timestamp = timestamp; 1074 if ((input->touch_focus) && (!input->grab))
1075 {
1076 ecore_wl_input_grab(input, input->touch_focus, BTN_LEFT);
1077 input->grab_timestamp = timestamp;
1078 }
1073 } 1079 }
1074 1080
1075 _ecore_wl_input_mouse_down_send(input, input->touch_focus, 1081 _ecore_wl_input_mouse_down_send(input, input->touch_focus,
1076 id, BTN_LEFT, timestamp); 1082 id, BTN_LEFT, timestamp);
1083
1084 input->grab_count++;
1077} 1085}
1078 1086
1079static void 1087static void
1080_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id) 1088_ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id)
1081{ 1089{
1082 Ecore_Wl_Input *input; 1090 Ecore_Wl_Input *input;
@@ -1090,11 +1098,13 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsi
1090 input->display->serial = serial; 1098 input->display->serial = serial;
1091 1099
1092 _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp); 1100 _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp);
1093 if ((input->grab) && (input->grab_button == BTN_LEFT)) 1101 input->grab_count--;
1102 if ((input->grab) && (input->grab_button == BTN_LEFT) &&
1103 (!input->grab_count))
1094 ecore_wl_input_ungrab(input); 1104 ecore_wl_input_ungrab(input);
1095} 1105}
1096 1106
1097static void 1107static void
1098_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) 1108_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)
1099{ 1109{
1100 Ecore_Wl_Input *input; 1110 Ecore_Wl_Input *input;
@@ -1111,19 +1121,19 @@ _ecore_wl_input_cb_touch_motion(void *data, struct wl_touch *touch EINA_UNUSED,
1111 _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id); 1121 _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
1112} 1122}
1113 1123
1114static void 1124static void
1115_ecore_wl_input_cb_touch_frame(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED) 1125_ecore_wl_input_cb_touch_frame(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED)
1116{ 1126{
1117 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1127 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1118} 1128}
1119 1129
1120static void 1130static void
1121_ecore_wl_input_cb_touch_cancel(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED) 1131_ecore_wl_input_cb_touch_cancel(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED)
1122{ 1132{
1123 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1133 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1124} 1134}
1125 1135
1126static void 1136static void
1127_ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer) 1137_ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
1128{ 1138{
1129 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1139 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1131,7 +1141,7 @@ _ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, st
1131 _ecore_wl_dnd_add(data, data_device, offer); 1141 _ecore_wl_dnd_add(data, data_device, offer);
1132} 1142}
1133 1143
1134static void 1144static void
1135_ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, unsigned int timestamp, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *offer) 1145_ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, unsigned int timestamp, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *offer)
1136{ 1146{
1137 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1147 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1141,7 +1151,7 @@ _ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, un
1141 _ecore_wl_dnd_enter(data, data_device, timestamp, surface, x, y, offer); 1151 _ecore_wl_dnd_enter(data, data_device, timestamp, surface, x, y, offer);
1142} 1152}
1143 1153
1144static void 1154static void
1145_ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device) 1155_ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device)
1146{ 1156{
1147 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1157 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1149,7 +1159,7 @@ _ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device)
1149 _ecore_wl_dnd_leave(data, data_device); 1159 _ecore_wl_dnd_leave(data, data_device);
1150} 1160}
1151 1161
1152static void 1162static void
1153_ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, wl_fixed_t x, wl_fixed_t y) 1163_ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, wl_fixed_t x, wl_fixed_t y)
1154{ 1164{
1155 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1165 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1157,7 +1167,7 @@ _ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, u
1157 _ecore_wl_dnd_motion(data, data_device, timestamp, x, y); 1167 _ecore_wl_dnd_motion(data, data_device, timestamp, x, y);
1158} 1168}
1159 1169
1160static void 1170static void
1161_ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device) 1171_ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device)
1162{ 1172{
1163 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1173 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1165,7 +1175,7 @@ _ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device)
1165 _ecore_wl_dnd_drop(data, data_device); 1175 _ecore_wl_dnd_drop(data, data_device);
1166} 1176}
1167 1177
1168static void 1178static void
1169_ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer) 1179_ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
1170{ 1180{
1171 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1181 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1173,7 +1183,7 @@ _ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device
1173 _ecore_wl_dnd_selection(data, data_device, offer); 1183 _ecore_wl_dnd_selection(data, data_device, offer);
1174} 1184}
1175 1185
1176static void 1186static void
1177_ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp, int device) 1187_ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp, int device)
1178{ 1188{
1179 Ecore_Event_Mouse_Move *ev; 1189 Ecore_Event_Mouse_Move *ev;
@@ -1215,7 +1225,7 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
1215 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); 1225 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
1216} 1226}
1217 1227
1218static void 1228static void
1219_ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp) 1229_ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp)
1220{ 1230{
1221 Ecore_Wl_Event_Mouse_In *ev; 1231 Ecore_Wl_Event_Mouse_In *ev;
@@ -1240,7 +1250,7 @@ _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
1240 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL); 1250 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL);
1241} 1251}
1242 1252
1243static void 1253static void
1244_ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp) 1254_ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp)
1245{ 1255{
1246 Ecore_Wl_Event_Mouse_Out *ev; 1256 Ecore_Wl_Event_Mouse_Out *ev;
@@ -1265,7 +1275,7 @@ _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsi
1265 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL); 1275 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL);
1266} 1276}
1267 1277
1268static void 1278static void
1269_ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp) 1279_ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp)
1270{ 1280{
1271 Ecore_Wl_Event_Focus_In *ev; 1281 Ecore_Wl_Event_Focus_In *ev;
@@ -1278,7 +1288,7 @@ _ecore_wl_input_focus_in_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window
1278 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL); 1288 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL);
1279} 1289}
1280 1290
1281static void 1291static void
1282_ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp) 1292_ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Window *win, unsigned int timestamp)
1283{ 1293{
1284 Ecore_Wl_Event_Focus_Out *ev; 1294 Ecore_Wl_Event_Focus_Out *ev;
@@ -1291,7 +1301,7 @@ _ecore_wl_input_focus_out_send(Ecore_Wl_Input *input EINA_UNUSED, Ecore_Wl_Windo
1291 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL); 1301 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL);
1292} 1302}
1293 1303
1294static void 1304static void
1295_ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp) 1305_ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp)
1296{ 1306{
1297 Ecore_Event_Mouse_Button *ev; 1307 Ecore_Event_Mouse_Button *ev;
@@ -1338,7 +1348,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int
1338 //Check Double Clicked 1348 //Check Double Clicked
1339 if (((int)(timestamp - down_info->last_time) <= 1349 if (((int)(timestamp - down_info->last_time) <=
1340 (int)(1000 * _ecore_wl_double_click_time)) && 1350 (int)(1000 * _ecore_wl_double_click_time)) &&
1341 ((win) && 1351 ((win) &&
1342 (win->id == down_info->last_win) && 1352 (win->id == down_info->last_win) &&
1343 (win->id == down_info->last_event_win))) 1353 (win->id == down_info->last_event_win)))
1344 { 1354 {
@@ -1354,7 +1364,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int
1354 //Check Triple Clicked 1364 //Check Triple Clicked
1355 if (((int)(timestamp - down_info->last_last_time) <= 1365 if (((int)(timestamp - down_info->last_last_time) <=
1356 (int)(2 * 1000 * _ecore_wl_double_click_time)) && 1366 (int)(2 * 1000 * _ecore_wl_double_click_time)) &&
1357 ((win) && 1367 ((win) &&
1358 (win->id == down_info->last_win) && 1368 (win->id == down_info->last_win) &&
1359 (win->id == down_info->last_last_win) && 1369 (win->id == down_info->last_last_win) &&
1360 (win->id == down_info->last_event_win) && 1370 (win->id == down_info->last_event_win) &&
@@ -1400,7 +1410,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int
1400 } 1410 }
1401} 1411}
1402 1412
1403static void 1413static void
1404_ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp) 1414_ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int device, unsigned int button, unsigned int timestamp)
1405{ 1415{
1406 Ecore_Event_Mouse_Button *ev; 1416 Ecore_Event_Mouse_Button *ev;
@@ -1464,7 +1474,7 @@ _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, int d
1464 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); 1474 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
1465} 1475}
1466 1476
1467static void 1477static void
1468_ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp) 1478_ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp)
1469{ 1479{
1470 Ecore_Event_Mouse_Wheel *ev; 1480 Ecore_Event_Mouse_Wheel *ev;
diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h
index 78f7dcdbe4..16af605586 100644
--- a/src/lib/ecore_wayland/ecore_wl_private.h
+++ b/src/lib/ecore_wayland/ecore_wl_private.h
@@ -217,6 +217,7 @@ struct _Ecore_Wl_Input
217 Ecore_Wl_Window *grab; 217 Ecore_Wl_Window *grab;
218 unsigned int grab_button; 218 unsigned int grab_button;
219 unsigned int grab_timestamp; 219 unsigned int grab_timestamp;
220 unsigned int grab_count;
220 221
221 Ecore_Wl_Dnd_Source *drag_source; 222 Ecore_Wl_Dnd_Source *drag_source;
222 Ecore_Wl_Dnd_Source *selection_source; 223 Ecore_Wl_Dnd_Source *selection_source;