diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-08-11 18:43:15 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-08-11 18:43:13 -0400 |
commit | 5ffb7d423cbf89a1f738492a77417b9578b1d37a (patch) | |
tree | 50c4586a018e85d66218518e2b5c2261e732927f /src | |
parent | 2d1e5da35dcbe0c913ec19170dd59fa9f2f378cc (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_private.h | 2 | ||||
-rw-r--r-- | src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c | 36 |
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 | |||
202 | struct | 202 | struct |
203 | { | 203 | { |
204 | Eina_Bool configure : 1; | 204 | Eina_Bool configure : 1; |
205 | Eina_Bool min : 1; | ||
206 | Eina_Bool max : 1; | ||
205 | } pending; | 207 | } pending; |
206 | 208 | ||
207 | struct | 209 | 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) | |||
194 | ee->w = w; | 194 | ee->w = w; |
195 | ee->h = h; | 195 | ee->h = h; |
196 | 196 | ||
197 | if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min) | ||
198 | { | ||
199 | wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h); | ||
200 | wdata->win->pending.min = 0; | ||
201 | } | ||
202 | if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max) | ||
203 | { | ||
204 | wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h); | ||
205 | wdata->win->pending.max = 0; | ||
206 | } | ||
207 | |||
197 | if (!ee->prop.fullscreen) | 208 | if (!ee->prop.fullscreen) |
198 | { | 209 | { |
199 | int fw = 0, fh = 0; | 210 | int fw = 0, fh = 0; |
@@ -1451,7 +1462,12 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h) | |||
1451 | ee->prop.min.h = h; | 1462 | ee->prop.min.h = h; |
1452 | wdata = ee->engine.data; | 1463 | wdata = ee->engine.data; |
1453 | if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel) | 1464 | if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel) |
1454 | wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h); | 1465 | { |
1466 | wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h); | ||
1467 | wdata->win->pending.min = 0; | ||
1468 | } | ||
1469 | else | ||
1470 | wdata->win->pending.min = 1; | ||
1455 | _ecore_evas_wl_common_resize(ee, ee->w, ee->h); | 1471 | _ecore_evas_wl_common_resize(ee, ee->w, ee->h); |
1456 | } | 1472 | } |
1457 | 1473 | ||
@@ -1469,7 +1485,12 @@ _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h) | |||
1469 | ee->prop.max.h = h; | 1485 | ee->prop.max.h = h; |
1470 | wdata = ee->engine.data; | 1486 | wdata = ee->engine.data; |
1471 | if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel) | 1487 | if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel) |
1472 | wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h); | 1488 | { |
1489 | wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h); | ||
1490 | wdata->win->pending.max = 0; | ||
1491 | } | ||
1492 | else | ||
1493 | wdata->win->pending.max = 1; | ||
1473 | _ecore_evas_wl_common_resize(ee, ee->w, ee->h); | 1494 | _ecore_evas_wl_common_resize(ee, ee->w, ee->h); |
1474 | } | 1495 | } |
1475 | 1496 | ||
@@ -1977,6 +1998,17 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee) | |||
1977 | { | 1998 | { |
1978 | int fw, fh; | 1999 | int fw, fh; |
1979 | 2000 | ||
2001 | if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min) | ||
2002 | { | ||
2003 | wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h); | ||
2004 | wdata->win->pending.min = 0; | ||
2005 | } | ||
2006 | if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max) | ||
2007 | { | ||
2008 | wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h); | ||
2009 | wdata->win->pending.max = 0; | ||
2010 | } | ||
2011 | |||
1980 | evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); | 2012 | evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); |
1981 | 2013 | ||
1982 | ecore_wl2_window_geometry_set(wdata->win, 0, 0, ee->w, ee->h); | 2014 | ecore_wl2_window_geometry_set(wdata->win, 0, 0, ee->w, ee->h); |