From 5a2cb308a9d3c683e5501f612612524dd4704fd8 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 28 Nov 2018 14:18:45 -0600 Subject: [PATCH] ecore_wl2: Replace direct usage of set_config.geometry with getters I'm going to deal with some ugly geometry problems in the getter func shortly. Signed-off-by: Derek Foreman Reviewed-by: Chris Michael Differential Revision: https://phab.enlightenment.org/D7431 --- src/lib/ecore_wl2/ecore_wl2_window.c | 36 +++++++++++++++--------------------- src/lib/ecore_wl2/window_v6.x | 10 +++++----- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 3a0c4bb..6e8bdfe 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -392,6 +392,7 @@ static const struct xdg_popup_listener _xdg_popup_listener = static void _ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win) { + int gx, gy, gw, gh; struct xdg_positioner *pos; EINA_SAFETY_ON_NULL_RETURN(win->parent); @@ -400,11 +401,9 @@ _ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win) pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell); if (!pos) return; - xdg_positioner_set_anchor_rect(pos, win->set_config.geometry.x, - win->set_config.geometry.y, - 1, 1); - xdg_positioner_set_size(pos, win->set_config.geometry.w, - win->set_config.geometry.h); + ecore_wl2_window_geometry_get(win, &gx, &gy, &gw, &gh); + xdg_positioner_set_anchor_rect(pos, gx, gy, 1, 1); + xdg_positioner_set_size(pos, gw, gh); xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT); xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM | ZXDG_POSITIONER_V6_ANCHOR_RIGHT); @@ -907,20 +906,18 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window) { if (window->uuid) { + int gx, gy, gw, gh; + zwp_e_session_recovery_set_uuid(window->display->wl.session_recovery, window->surface, window->uuid); + + ecore_wl2_window_geometry_get(window, &gx, &gy, &gw, &gh); if (window->xdg_surface) xdg_surface_set_window_geometry(window->xdg_surface, - window->set_config.geometry.x, - window->set_config.geometry.y, - window->set_config.geometry.w, - window->set_config.geometry.h); + gx, gy, gw, gh); if (window->zxdg_surface) zxdg_surface_v6_set_window_geometry(window->zxdg_surface, - window->set_config.geometry.x, - window->set_config.geometry.y, - window->set_config.geometry.w, - window->set_config.geometry.h); + gx, gy, gw, gh); ecore_wl2_window_opaque_region_set(window, window->opaque.x, @@ -3053,18 +3050,15 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush) /* Dispatch any state we've been saving along the way */ if (window->pending.geom) { + int gx, gy, gw, gh; + + ecore_wl2_window_geometry_get(window, &gx, &gy, &gw, &gh); if (window->xdg_toplevel) xdg_surface_set_window_geometry(window->xdg_surface, - window->set_config.geometry.x, - window->set_config.geometry.y, - window->set_config.geometry.w, - window->set_config.geometry.h); + gx, gy, gw, gh); if (window->zxdg_surface) zxdg_surface_v6_set_window_geometry(window->zxdg_surface, - window->set_config.geometry.x, - window->set_config.geometry.y, - window->set_config.geometry.w, - window->set_config.geometry.h); + gx, gy, gw, gh); } if (window->pending.opaque || window->pending.input) _regions_set(window); diff --git a/src/lib/ecore_wl2/window_v6.x b/src/lib/ecore_wl2/window_v6.x index cb7501a..8ec1496 100644 --- a/src/lib/ecore_wl2/window_v6.x +++ b/src/lib/ecore_wl2/window_v6.x @@ -109,16 +109,16 @@ static void _window_v6_popup_create(Ecore_Wl2_Window *win) { struct zxdg_positioner_v6 *pos; + int wx, wy, ww, wh; EINA_SAFETY_ON_NULL_RETURN(win->parent); pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell); if (!pos) return; - zxdg_positioner_v6_set_anchor_rect(pos, win->set_config.geometry.x, - win->set_config.geometry.y, - 1, 1); - zxdg_positioner_v6_set_size(pos, win->set_config.geometry.w, - win->set_config.geometry.h); + ecore_wl2_window_geometry_get(win, &wx, &wy, &ww, &wh); + + zxdg_positioner_v6_set_anchor_rect(pos, wx, wy, 1, 1); + zxdg_positioner_v6_set_size(pos, ww, wh); zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP | ZXDG_POSITIONER_V6_ANCHOR_LEFT); zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM | -- 2.7.4