From 0dd9ae831cc4a794a12b88afd576629917d0b1fc Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 9 Nov 2015 11:55:21 -0500 Subject: [PATCH] ecore-evas-wl: Fix issue of resize jumping Summary: When an initial client application was shown and we tried to resize it, the resize would jump by the amount of framespace. This was because the xdg_surface@configure event would be sending window geometry as the width/height params in the event. We need to account for that in the callback of window configure and adjust size accordingly. @fix Signed-off-by: Chris Michael --- .../wayland/ecore_evas_wayland_common.c | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 1e8a15c022..fa19cbdc0e 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -191,6 +191,22 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_ if (nw < 1) nw = 1; if (nh < 1) nh = 1; + /* NB: We receive window configure sizes based on xdg surface + * window geometry, so we need to subtract framespace here */ + + evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); + + if (ECORE_EVAS_PORTRAIT(ee)) + { + nw -= fw; + nh -= fh; + } + else + { + nw -= fh; + nh -= fw; + } + if (prev_full != ee->prop.fullscreen) _ecore_evas_wl_common_border_update(ee); @@ -648,10 +664,10 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h) if (wdata->win) { - int x, y; - - ecore_wl2_window_geometry_get(wdata->win, &x, &y, NULL, NULL); - ecore_wl2_window_geometry_set(wdata->win, x, y, w, h); + if (ECORE_EVAS_PORTRAIT(ee)) + ecore_wl2_window_geometry_set(wdata->win, 0, 0, w, h); + else + ecore_wl2_window_geometry_set(wdata->win, 0, 0, h, w); } if (ee->func.fn_resize) ee->func.fn_resize(ee);