summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-01-07 14:47:55 -0500
committerChris Michael <cp.michael@samsung.com>2015-01-07 14:50:00 -0500
commitbf9c5873fb0a8c6cc006237844022e7468f0a5e1 (patch)
tree95beda3a2afdcc9db0ef080eccfa67cd4b5a86db /src/modules
parent080b9e473064e84af804a9fdc2148891327b59f7 (diff)
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>
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c43
1 files changed, 28 insertions, 15 deletions
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 e8b0853715..dfc31bcf73 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
@@ -608,25 +608,33 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
608 if (!ee->prop.fullscreen) 608 if (!ee->prop.fullscreen)
609 { 609 {
610 int fw = 0, fh = 0; 610 int fw = 0, fh = 0;
611 int maxw, maxh; 611 int maxw = 0, maxh = 0;
612 int minw, minh; 612 int minw = 0, minh = 0;
613 double a; 613 double a = 0.0;
614 614
615 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); 615 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
616 616
617 if (ECORE_EVAS_PORTRAIT(ee)) 617 if (ECORE_EVAS_PORTRAIT(ee))
618 { 618 {
619 minw = (ee->prop.min.w - fw); 619 if (ee->prop.min.w > 0)
620 minh = (ee->prop.min.h - fh); 620 minw = (ee->prop.min.w - fw);
621 maxw = (ee->prop.max.w + fw); 621 if (ee->prop.min.h > 0)
622 maxh = (ee->prop.max.h + fh); 622 minh = (ee->prop.min.h - fh);
623 if (ee->prop.max.w > 0)
624 maxw = (ee->prop.max.w + fw);
625 if (ee->prop.max.h > 0)
626 maxh = (ee->prop.max.h + fh);
623 } 627 }
624 else 628 else
625 { 629 {
626 minw = (ee->prop.min.w - fh); 630 if (ee->prop.min.w > 0)
627 minh = (ee->prop.min.h - fw); 631 minw = (ee->prop.min.w - fh);
628 maxw = (ee->prop.max.w + fh); 632 if (ee->prop.min.h > 0)
629 maxh = (ee->prop.max.h + fw); 633 minh = (ee->prop.min.h - fw);
634 if (ee->prop.max.w > 0)
635 maxw = (ee->prop.max.w + fh);
636 if (ee->prop.max.h > 0)
637 maxh = (ee->prop.max.h + fw);
630 } 638 }
631 639
632 /* adjust size using aspect */ 640 /* adjust size using aspect */
@@ -690,10 +698,15 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
690 h = (minh + (((h - minh) / ee->prop.step.h) * ee->prop.step.h)); 698 h = (minh + (((h - minh) / ee->prop.step.h) * ee->prop.step.h));
691 } 699 }
692 700
693 if (w > maxw) w = maxw; 701 if ((maxw > 0) && (w > maxw))
694 else if (w < minw) w = minw; 702 w = maxw;
695 if (h > maxh) h = maxh; 703 else if (w < minw)
696 else if (h < minh) h = minh; 704 w = minw;
705
706 if ((maxh > 0) && (h > maxh))
707 h = maxh;
708 else if (h < minh)
709 h = minh;
697 710
698 orig_w = w; 711 orig_w = w;
699 orig_h = h; 712 orig_h = h;