devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7918f40fccf05ea3a69540869d1e71149603b2b4

commit 7918f40fccf05ea3a69540869d1e71149603b2b4
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Sep 23 12:42:49 2015 -0400

    ecore-wl2: Raise focus in/out events when we get wayland events for
    keyboard enter/leave
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/ecore_wl2_input.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c 
b/src/lib/ecore_wl2/ecore_wl2_input.c
index f7db267..7058040 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -214,6 +214,32 @@ _ecore_wl2_input_mouse_up_send(Ecore_Wl2_Input *input, 
Ecore_Wl2_Window *window,
    ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
 }
 
+static void
+_ecore_wl2_input_focus_in_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window 
*window)
+{
+   Ecore_Wl2_Event_Focus_In *ev;
+
+   ev = calloc(1, sizeof(Ecore_Wl2_Event_Focus_In));
+   if (!ev) return;
+
+   ev->timestamp = input->timestamp;
+   ev->window = window->id;
+   ecore_event_add(ECORE_WL2_EVENT_FOCUS_IN, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl2_input_focus_out_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window 
*window)
+{
+   Ecore_Wl2_Event_Focus_Out *ev;
+
+   ev = calloc(1, sizeof(Ecore_Wl2_Event_Focus_Out));
+   if (!ev) return;
+
+   ev->timestamp = input->timestamp;
+   ev->window = window->id;
+   ecore_event_add(ECORE_WL2_EVENT_FOCUS_OUT, ev, NULL, NULL);
+}
+
 void
 _ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, 
unsigned int button)
 {
@@ -460,7 +486,7 @@ _keyboard_cb_enter(void *data, struct wl_keyboard *keyboard 
EINA_UNUSED, unsigne
 
    input->focus.keyboard = window;
 
-   /* TODO: Send keyboard enter event (focus in) */
+   _ecore_wl2_input_focus_in_send(input, window);
 }
 
 static void
@@ -484,7 +510,7 @@ _keyboard_cb_leave(void *data, struct wl_keyboard *keyboard 
EINA_UNUSED, unsigne
    window = _ecore_wl2_display_window_surface_find(input->display, surface);
    if (!window) return;
 
-   /* TODO: Send keyboard leave event (focus out) */
+   _ecore_wl2_input_focus_out_send(input, window);
 
    input->focus.keyboard = NULL;
 }

-- 


Reply via email to