ecore-wl2: Call input ungrab when window operations occur

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-09-23 12:13:44 -04:00
parent 6d3e8a8558
commit 5254b1a327
3 changed files with 14 additions and 5 deletions

View 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))

View 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

View 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) */