From f53c7341c367e8c04c57650f182a186869eb7e54 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 df4045007b..87ef49dfe8 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -304,17 +304,16 @@ 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); pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base); 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); @@ -408,20 +407,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, @@ -1568,18 +1565,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 333586a2ac..24e453c057 100644 --- a/src/lib/ecore_wl2/window_v6.x +++ b/src/lib/ecore_wl2/window_v6.x @@ -107,16 +107,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 |