forked from enlightenment/efl
ecore-evas-wayland: Fix min/max size calculations
Summary: This fixes an issue for windows which do not set a min or max size in the properties. This was discovered when running Enlightenment in a Wayland-Only scenario, and trying to bring up the settings panel which would cause an endless loop in calculating the proper window size due to min/max not being set. @fix NB: Thanks to Mike for the help in tracing this ! :) Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
080b9e4730
commit
bf9c5873fb
|
@ -608,25 +608,33 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
|
||||||
if (!ee->prop.fullscreen)
|
if (!ee->prop.fullscreen)
|
||||||
{
|
{
|
||||||
int fw = 0, fh = 0;
|
int fw = 0, fh = 0;
|
||||||
int maxw, maxh;
|
int maxw = 0, maxh = 0;
|
||||||
int minw, minh;
|
int minw = 0, minh = 0;
|
||||||
double a;
|
double a = 0.0;
|
||||||
|
|
||||||
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
|
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
|
||||||
|
|
||||||
if (ECORE_EVAS_PORTRAIT(ee))
|
if (ECORE_EVAS_PORTRAIT(ee))
|
||||||
{
|
{
|
||||||
minw = (ee->prop.min.w - fw);
|
if (ee->prop.min.w > 0)
|
||||||
minh = (ee->prop.min.h - fh);
|
minw = (ee->prop.min.w - fw);
|
||||||
maxw = (ee->prop.max.w + fw);
|
if (ee->prop.min.h > 0)
|
||||||
maxh = (ee->prop.max.h + fh);
|
minh = (ee->prop.min.h - fh);
|
||||||
|
if (ee->prop.max.w > 0)
|
||||||
|
maxw = (ee->prop.max.w + fw);
|
||||||
|
if (ee->prop.max.h > 0)
|
||||||
|
maxh = (ee->prop.max.h + fh);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
minw = (ee->prop.min.w - fh);
|
if (ee->prop.min.w > 0)
|
||||||
minh = (ee->prop.min.h - fw);
|
minw = (ee->prop.min.w - fh);
|
||||||
maxw = (ee->prop.max.w + fh);
|
if (ee->prop.min.h > 0)
|
||||||
maxh = (ee->prop.max.h + fw);
|
minh = (ee->prop.min.h - fw);
|
||||||
|
if (ee->prop.max.w > 0)
|
||||||
|
maxw = (ee->prop.max.w + fh);
|
||||||
|
if (ee->prop.max.h > 0)
|
||||||
|
maxh = (ee->prop.max.h + fw);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust size using aspect */
|
/* adjust size using aspect */
|
||||||
|
@ -690,10 +698,15 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
|
||||||
h = (minh + (((h - minh) / ee->prop.step.h) * ee->prop.step.h));
|
h = (minh + (((h - minh) / ee->prop.step.h) * ee->prop.step.h));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w > maxw) w = maxw;
|
if ((maxw > 0) && (w > maxw))
|
||||||
else if (w < minw) w = minw;
|
w = maxw;
|
||||||
if (h > maxh) h = maxh;
|
else if (w < minw)
|
||||||
else if (h < minh) h = minh;
|
w = minw;
|
||||||
|
|
||||||
|
if ((maxh > 0) && (h > maxh))
|
||||||
|
h = maxh;
|
||||||
|
else if (h < minh)
|
||||||
|
h = minh;
|
||||||
|
|
||||||
orig_w = w;
|
orig_w = w;
|
||||||
orig_h = h;
|
orig_h = h;
|
||||||
|
|
Loading…
Reference in New Issue