ecore-wl2: Call input ungrab when window operations occur
authorChris Michael <cp.michael@samsung.com>
Wed, 23 Sep 2015 16:13:44 +0000 (12:13 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 3 Dec 2015 17:02:40 +0000 (12:02 -0500)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/ecore_wl2_input.c
src/lib/ecore_wl2/ecore_wl2_private.h
src/lib/ecore_wl2/ecore_wl2_window.c

index b4b1130..f7db267 100644 (file)
@@ -214,14 +214,14 @@ _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
+void
 _ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button)
 {
    input->grab.window = window;
    input->grab.button = button;
 }
 
-static void
+void
 _ecore_wl2_input_ungrab(Ecore_Wl2_Input *input)
 {
    if ((input->grab.window) && (input->grab.button))
index 8cf8d2d..0b7e042 100644 (file)
@@ -74,6 +74,7 @@ struct _Ecore_Wl2_Window
    EINA_INLIST;
 
    Ecore_Wl2_Display *display;
+   Ecore_Wl2_Input *input;
 
    Ecore_Wl2_Window *parent;
 
@@ -203,4 +204,7 @@ void _ecore_wl2_output_del(Ecore_Wl2_Output *output);
 void _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id);
 void _ecore_wl2_input_del(Ecore_Wl2_Input *input);
 
+void _ecore_wl2_input_ungrab(Ecore_Wl2_Input *input);
+void _ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button);
+
 #endif
index 12c63f3..cbfb826 100644 (file)
@@ -28,7 +28,12 @@ _wl_shell_surface_cb_configure(void *data, struct wl_shell_surface *shell_surfac
 static void
 _wl_shell_surface_cb_popup_done(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface EINA_UNUSED)
 {
-   /* TODO: input ungrab ? */
+   Ecore_Wl2_Window *win;
+
+   win = data;
+   if (!win) return;
+
+   _ecore_wl2_input_ungrab(win->input);
 }
 
 static const struct wl_shell_surface_listener _wl_shell_surface_listener =
@@ -322,7 +327,7 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, int x, int y)
    window->geometry.x = x;
    window->geometry.y = y;
 
-   /* TODO: input grab release ? */
+   _ecore_wl2_input_ungrab(window->input);
 
    /* TODO: enable once input is done */
    /* if (window->xdg_surface) */
@@ -344,7 +349,7 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, int w, int h, int location)
    window->geometry.w = w;
    window->geometry.h = h;
 
-   /* TODO: input grab release ? */
+   _ecore_wl2_input_ungrab(window->input);
 
    /* TODO: enable once input is done */
    /* if (window->xdg_surface) */