aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-08-11 18:43:15 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-08-11 18:43:13 -0400
commit5ffb7d423cbf89a1f738492a77417b9578b1d37a (patch)
tree50c4586a018e85d66218518e2b5c2261e732927f
parentefl-wl: add functionality for extracting surfaces for external use (diff)
downloadefl-5ffb7d423cbf89a1f738492a77417b9578b1d37a.tar.gz
wayland: set min/max size hints to surface before show
with deferred surface creation the first canvas change of hints may not be able to trigger protocol methods for size hints, so ensure that hints are set
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h2
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c36
2 files changed, 36 insertions, 2 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index 0f664097f7..431d40880e 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -202,6 +202,8 @@ struct _Ecore_Wl2_Window
struct
{
Eina_Bool configure : 1;
+ Eina_Bool min : 1;
+ Eina_Bool max : 1;
} pending;
struct
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 666fc9a004..ad307edd51 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
@@ -194,6 +194,17 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
ee->w = w;
ee->h = h;
+ if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
+ {
+ wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h);
+ wdata->win->pending.min = 0;
+ }
+ if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max)
+ {
+ wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h);
+ wdata->win->pending.max = 0;
+ }
+
if (!ee->prop.fullscreen)
{
int fw = 0, fh = 0;
@@ -1451,7 +1462,12 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
ee->prop.min.h = h;
wdata = ee->engine.data;
if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel)
- wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h);
+ {
+ wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h);
+ wdata->win->pending.min = 0;
+ }
+ else
+ wdata->win->pending.min = 1;
_ecore_evas_wl_common_resize(ee, ee->w, ee->h);
}
@@ -1469,7 +1485,12 @@ _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
ee->prop.max.h = h;
wdata = ee->engine.data;
if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel)
- wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h);
+ {
+ wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h);
+ wdata->win->pending.max = 0;
+ }
+ else
+ wdata->win->pending.max = 1;
_ecore_evas_wl_common_resize(ee, ee->w, ee->h);
}
@@ -1977,6 +1998,17 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
{
int fw, fh;
+ if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
+ {
+ wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h);
+ wdata->win->pending.min = 0;
+ }
+ if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max)
+ {
+ wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h);
+ wdata->win->pending.max = 0;
+ }
+
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
ecore_wl2_window_geometry_set(wdata->win, 0, 0, ee->w, ee->h);