summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-02-08 11:51:21 -0500
committerChris Michael <cp.michael@samsung.com>2017-02-08 11:54:07 -0500
commit4b2188103d22b591a062c25c5154636bac727616 (patch)
tree840c7dda6e57edd5a6070f667abb5650e37946ba /src/lib/ecore_wl2/ecore_wl2_input.c
parent62a22fd401128affb4f9bdca6d6db35a90dd6e19 (diff)
ecore-wl2: Don't send focus in/out events based on keyboard enter/leave
We should not be sending focus events based on keyboard behaviour, but rather send them according to xdg shell activate status. This makes our focus behaviour more "standards" compliant. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 96665b9091..636ddf93ba 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -408,10 +408,14 @@ _ecore_wl2_input_mouse_up_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window,
408 _input_event_cb_free, ev->dev); 408 _input_event_cb_free, ev->dev);
409} 409}
410 410
411static void 411void
412_ecore_wl2_input_focus_in_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window) 412_ecore_wl2_input_focus_in_send(Ecore_Wl2_Window *window)
413{ 413{
414 Ecore_Wl2_Event_Focus_In *ev; 414 Ecore_Wl2_Event_Focus_In *ev;
415 Ecore_Wl2_Input *input;
416
417 input = ecore_wl2_window_input_get(window);
418 if (!input) return;
415 419
416 ev = calloc(1, sizeof(Ecore_Wl2_Event_Focus_In)); 420 ev = calloc(1, sizeof(Ecore_Wl2_Event_Focus_In));
417 if (!ev) return; 421 if (!ev) return;
@@ -423,10 +427,14 @@ _ecore_wl2_input_focus_in_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
423 ev->dev); 427 ev->dev);
424} 428}
425 429
426static void 430void
427_ecore_wl2_input_focus_out_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window) 431_ecore_wl2_input_focus_out_send(Ecore_Wl2_Window *window)
428{ 432{
429 Ecore_Wl2_Event_Focus_Out *ev; 433 Ecore_Wl2_Event_Focus_Out *ev;
434 Ecore_Wl2_Input *input;
435
436 input = ecore_wl2_window_input_get(window);
437 if (!input) return;
430 438
431 ev = calloc(1, sizeof(Ecore_Wl2_Event_Focus_Out)); 439 ev = calloc(1, sizeof(Ecore_Wl2_Event_Focus_Out));
432 if (!ev) return; 440 if (!ev) return;
@@ -846,15 +854,12 @@ _keyboard_cb_enter(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigne
846 854
847 input->focus.keyboard = window; 855 input->focus.keyboard = window;
848 window->input = input; 856 window->input = input;
849
850 _ecore_wl2_input_focus_in_send(input, window);
851} 857}
852 858
853static void 859static void
854_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface) 860_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface EINA_UNUSED)
855{ 861{
856 Ecore_Wl2_Input *input; 862 Ecore_Wl2_Input *input;
857 Ecore_Wl2_Window *window;
858 863
859 input = data; 864 input = data;
860 if (!input) return; 865 if (!input) return;
@@ -866,13 +871,6 @@ _keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigne
866 input->repeat.time = 0; 871 input->repeat.time = 0;
867 if (input->repeat.timer) ecore_timer_del(input->repeat.timer); 872 if (input->repeat.timer) ecore_timer_del(input->repeat.timer);
868 input->repeat.timer = NULL; 873 input->repeat.timer = NULL;
869
870 /* find the window which this surface belongs to */
871 window = _ecore_wl2_display_window_surface_find(input->display, surface);
872 if (!window) return;
873
874 _ecore_wl2_input_focus_out_send(input, window);
875
876 input->focus.keyboard = NULL; 874 input->focus.keyboard = NULL;
877} 875}
878 876
@@ -1582,7 +1580,6 @@ ecore_wl2_input_seat_get(Ecore_Wl2_Input *input)
1582EAPI Ecore_Wl2_Seat_Capabilities 1580EAPI Ecore_Wl2_Seat_Capabilities
1583ecore_wl2_input_seat_capabilities_get(Ecore_Wl2_Input *input) 1581ecore_wl2_input_seat_capabilities_get(Ecore_Wl2_Input *input)
1584{ 1582{
1585
1586 Ecore_Wl2_Seat_Capabilities cap = ECORE_WL2_SEAT_CAPABILITIES_NONE; 1583 Ecore_Wl2_Seat_Capabilities cap = ECORE_WL2_SEAT_CAPABILITIES_NONE;
1587 1584
1588 EINA_SAFETY_ON_NULL_RETURN_VAL(input, cap); 1585 EINA_SAFETY_ON_NULL_RETURN_VAL(input, cap);