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
This commit is contained in:
Mike Blumenkrantz 2017-08-11 18:43:15 -04:00
parent 2d1e5da35d
commit 5ffb7d423c
2 changed files with 36 additions and 2 deletions

View File

@ -202,6 +202,8 @@ struct _Ecore_Wl2_Window
struct
{
Eina_Bool configure : 1;
Eina_Bool min : 1;
Eina_Bool max : 1;
} pending;
struct

View File

@ -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);