From e0b3d1250bb81f7b8effd5a67ac081ae5d9eda13 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 24 Sep 2015 11:50:36 -0400 Subject: [PATCH] ecore-wl2: Add support for window moving Signed-off-by: Chris Michael --- src/lib/ecore_wl2/ecore_wl2_window.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 2a36a99e3a..8facd1ac58 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -348,6 +348,8 @@ ecore_wl2_window_free(Ecore_Wl2_Window *window) EAPI void ecore_wl2_window_move(Ecore_Wl2_Window *window, int x, int y) { + Ecore_Wl2_Input *input; + EINA_SAFETY_ON_NULL_RETURN(window); /* test for no-op move */ @@ -357,14 +359,22 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, int x, int y) window->geometry.x = x; window->geometry.y = y; - _ecore_wl2_input_ungrab(window->input); + input = window->input; + if ((!input) && (window->parent)) + { + input = window->parent->input; + } - /* TODO: enable once input is done */ - /* if (window->xdg_surface) */ - /* xdg_surface_move(window->xdg_surface, seat, window->display->serial); */ - /* else if (window->wl_shell_surface) */ - /* wl_shell_surface_move(window->wl_shell_surface, seat, */ - /* window->display->serial); */ + if ((!input) || (!input->wl.seat)) return; + + _ecore_wl2_input_ungrab(input); + + if (window->xdg_surface) + xdg_surface_move(window->xdg_surface, input->wl.seat, + window->display->serial); + else if (window->wl_shell_surface) + wl_shell_surface_move(window->wl_shell_surface, input->wl.seat, + window->display->serial); } EAPI void