Ecore_Evas_Engine_Wl_Data *wdata;
Ecore_Wl_Event_Window_Configure *ev;
int nw = 0, nh = 0;
- int orig_w = 0, orig_h = 0;
+ int fw = 0, fh = 0;
Eina_Bool prev_max, prev_full;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
}
else
{
- int fw = 0, fh = 0;
- int maxw = 0, maxh = 0;
- int minw = 0, minh = 0;
- double a = 0.0;
-
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
+ }
- if (ECORE_EVAS_PORTRAIT(ee))
- {
- if (ee->prop.min.w > 0)
- minw = (ee->prop.min.w - fw);
- if (ee->prop.min.h > 0)
- 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
- {
- if (ee->prop.min.w > 0)
- minw = (ee->prop.min.w - fh);
- if (ee->prop.min.h > 0)
- 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 */
- if ((ee->prop.base.w >= 0) && (ee->prop.base.h >= 0))
- {
- int bw, bh;
-
- bw = (nw - ee->prop.base.w);
- bh = (nh - ee->prop.base.h);
- if (bw < 1) bw = 1;
- if (bh < 1) bh = 1;
- a = ((double)bw / (double)bh);
- if ((ee->prop.aspect != 0.0) && (a < ee->prop.aspect))
- {
- if ((nh < ee->h) > 0)
- bw = bh * ee->prop.aspect;
- else
- bw = bw / ee->prop.aspect;
-
- nw = bw + ee->prop.base.w;
- nh = bh + ee->prop.base.h;
- }
- else if ((ee->prop.aspect != 0.0) && (a > ee->prop.aspect))
- {
- bw = bh * ee->prop.aspect;
- nw = bw + ee->prop.base.w;
- }
- }
- else
- {
- a = ((double)nw / (double)nh);
- if ((ee->prop.aspect != 0.0) && (a < ee->prop.aspect))
- {
- if ((nh < ee->h) > 0)
- nw = nh * ee->prop.aspect;
- else
- nh = nw / ee->prop.aspect;
- }
- else if ((ee->prop.aspect != 0.0) && (a > ee->prop.aspect))
- nw = nh * ee->prop.aspect;
- }
-
- /* adjust size using base size & step size */
- if (ee->prop.step.w > 0)
- {
- if (ee->prop.base.w >= 0)
- nw = (ee->prop.base.w +
- (((nw - ee->prop.base.w) / ee->prop.step.w) *
- ee->prop.step.w));
- else
- nw = (minw + (((nw - minw) / ee->prop.step.w) * ee->prop.step.w));
- }
-
- if (ee->prop.step.h > 0)
- {
- if (ee->prop.base.h >= 0)
- nh = (ee->prop.base.h +
- (((nh - ee->prop.base.h) / ee->prop.step.h) *
- ee->prop.step.h));
- else
- nh = (minh + (((nh - minh) / ee->prop.step.h) * ee->prop.step.h));
- }
-
- if ((maxw > 0) && (nw > maxw))
- nw = maxw;
- else if (nw < minw)
- nw = minw;
-
- if ((maxh > 0) && (nh > maxh))
- nh = maxh;
- else if (nh < minh)
- nh = minh;
-
- orig_w = nw;
- orig_h = nh;
-
- if (ECORE_EVAS_PORTRAIT(ee))
- {
- nw -= fw;
- nh -= fh;
- }
- else
- {
- nw -= fh;
- nh -= fw;
- }
+ if (ECORE_EVAS_PORTRAIT(ee))
+ {
+ nw -= fw;
+ nh -= fh;
+ }
+ else
+ {
+ nw -= fh;
+ nh -= fw;
}
if (prev_full != ee->prop.fullscreen)
if ((ee->x != ev->x) || (ee->y != ev->y))
_ecore_evas_wl_common_move(ee, ev->x, ev->y);
- if ((ee->req.w != orig_w) || (ee->req.h != orig_h))
+ if ((ee->req.w != nw) || (ee->req.h != nh))
_ecore_evas_wl_common_resize(ee, nw, nh);
if ((prev_max != ee->prop.maximized) ||