summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-11-10 12:01:52 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-11-10 12:01:52 +0000
commit64ce7a2c45e1de3167f64feb08d7e2223aac5b60 (patch)
tree50c30277e93913c71873f9e4a2dfbbe864f44d86 /src/modules
parentfff5b4919ea8f6e7371512eff07e9643ca7291b0 (diff)
ecore evas - wayland clients - dont set invalid min/max width
max width < 0 is wrong.. dont set it. min width < 1 for efl is stupid/invalid and dont set it either, so clamp these and now things work right in corner cases. @fix
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c91
1 files changed, 64 insertions, 27 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 ab4190a1a8..5a815fdd90 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
@@ -323,7 +323,7 @@ static void
323_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h) 323_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
324{ 324{
325 Ecore_Evas_Engine_Wl_Data *wdata; 325 Ecore_Evas_Engine_Wl_Data *wdata;
326 int ow, oh, ew, eh, fw, fh; 326 int ow, oh, ew, eh, fw, fh, ww, hh;
327 int diff = 0; 327 int diff = 0;
328 328
329 LOGFN; 329 LOGFN;
@@ -348,30 +348,42 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
348 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && 348 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel &&
349 wdata->win->pending.min) 349 wdata->win->pending.min)
350 { 350 {
351 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, 351 ww = ee->prop.min.w + fw;
352 ee->prop.min.w + fw, ee->prop.min.h + fh); 352 hh = ee->prop.min.h + fh;
353 if (ww < 1) ww = 1;
354 if (hh < 1) hh = 1;
355 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ww, hh);
353 wdata->win->pending.min = 0; 356 wdata->win->pending.min = 0;
354 } 357 }
355 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && 358 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel &&
356 wdata->win->pending.max) 359 wdata->win->pending.max)
357 { 360 {
358 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, 361 ww = ee->prop.max.w + fw;
359 ee->prop.max.w + fw, ee->prop.max.h + fh); 362 hh = ee->prop.max.h + fh;
363 if (ww < 0) ww = 0;
364 if (hh < 0) hh = 0;
365 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ww, hh);
360 wdata->win->pending.max = 0; 366 wdata->win->pending.max = 0;
361 } 367 }
362 368
363 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && 369 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel &&
364 wdata->win->pending.min) 370 wdata->win->pending.min)
365 { 371 {
366 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, 372 ww = ee->prop.min.w + fw;
367 ee->prop.min.w + fw, ee->prop.min.h + fh); 373 hh = ee->prop.min.h + fh;
374 if (ww < 1) ww = 1;
375 if (hh < 1) hh = 1;
376 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ww, hh);
368 wdata->win->pending.min = 0; 377 wdata->win->pending.min = 0;
369 } 378 }
370 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && 379 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel &&
371 wdata->win->pending.max) 380 wdata->win->pending.max)
372 { 381 {
373 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, 382 ww = ee->prop.max.w + fw;
374 ee->prop.max.w + fw, ee->prop.max.h + fh); 383 hh = ee->prop.max.h + fh;
384 if (ww < 0) ww = 0;
385 if (hh < 0) hh = 0;
386 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ww, hh);
375 wdata->win->pending.max = 0; 387 wdata->win->pending.max = 0;
376 } 388 }
377 389
@@ -1687,7 +1699,7 @@ _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *
1687static void 1699static void
1688_ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h) 1700_ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
1689{ 1701{
1690 int fw, fh; 1702 int fw, fh, ww, hh;
1691 Ecore_Evas_Engine_Wl_Data *wdata; 1703 Ecore_Evas_Engine_Wl_Data *wdata;
1692 LOGFN; 1704 LOGFN;
1693 1705
@@ -1702,12 +1714,20 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
1702 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); 1714 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
1703 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel) 1715 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel)
1704 { 1716 {
1705 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, w + fw, h + fh); 1717 ww = w + fw;
1718 hh = h + fh;
1719 if (ww < 1) ww = 1;
1720 if (hh < 1) hh = 1;
1721 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ww, hh);
1706 wdata->win->pending.min = 0; 1722 wdata->win->pending.min = 0;
1707 } 1723 }
1708 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel) 1724 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel)
1709 { 1725 {
1710 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w + fw, h + fh); 1726 ww = w + fw;
1727 hh = h + fh;
1728 if (ww < 1) ww = 1;
1729 if (hh < 1) hh = 1;
1730 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ww, hh);
1711 wdata->win->pending.min = 0; 1731 wdata->win->pending.min = 0;
1712 } 1732 }
1713 else 1733 else
@@ -1718,7 +1738,7 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
1718static void 1738static void
1719_ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h) 1739_ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
1720{ 1740{
1721 int fw, fh; 1741 int fw, fh, ww, hh;
1722 Ecore_Evas_Engine_Wl_Data *wdata; 1742 Ecore_Evas_Engine_Wl_Data *wdata;
1723 LOGFN; 1743 LOGFN;
1724 1744
@@ -1732,12 +1752,20 @@ _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
1732 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); 1752 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
1733 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel) 1753 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel)
1734 { 1754 {
1735 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, w + fw, h + fh); 1755 ww = w + fw;
1756 hh = h + fh;
1757 if (ww < 0) ww = 0;
1758 if (hh < 0) hh = 0;
1759 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ww, hh);
1736 wdata->win->pending.max = 0; 1760 wdata->win->pending.max = 0;
1737 } 1761 }
1738 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel) 1762 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel)
1739 { 1763 {
1740 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w + fw, h + fh); 1764 ww = w + fw;
1765 hh = h + fh;
1766 if (ww < 0) ww = 0;
1767 if (hh < 0) hh = 0;
1768 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ww, hh);
1741 wdata->win->pending.max = 0; 1769 wdata->win->pending.max = 0;
1742 } 1770 }
1743 else 1771 else
@@ -2158,6 +2186,7 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
2158{ 2186{
2159 Evas_Engine_Info_Wayland *einfo; 2187 Evas_Engine_Info_Wayland *einfo;
2160 Ecore_Evas_Engine_Wl_Data *wdata; 2188 Ecore_Evas_Engine_Wl_Data *wdata;
2189 int ww, hh;
2161 2190
2162 LOGFN; 2191 LOGFN;
2163 2192
@@ -2179,33 +2208,41 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
2179 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && 2208 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel &&
2180 wdata->win->pending.min) 2209 wdata->win->pending.min)
2181 { 2210 {
2182 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, 2211 ww = ee->prop.min.w + fw;
2183 ee->prop.min.w + fw, 2212 hh = ee->prop.min.h + fh;
2184 ee->prop.min.h + fh); 2213 if (ww < 1) ww = 1;
2214 if (hh < 1) hh = 1;
2215 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ww, hh);
2185 wdata->win->pending.min = 0; 2216 wdata->win->pending.min = 0;
2186 } 2217 }
2187 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && 2218 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel &&
2188 wdata->win->pending.max) 2219 wdata->win->pending.max)
2189 { 2220 {
2190 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, 2221 ww = ee->prop.max.w + fw;
2191 ee->prop.max.w + fw, 2222 hh = ee->prop.max.h + fh;
2192 ee->prop.max.h + fh); 2223 if (ww < 0) ww = 0;
2224 if (hh < 0) hh = 0;
2225 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ww, hh);
2193 wdata->win->pending.max = 0; 2226 wdata->win->pending.max = 0;
2194 } 2227 }
2195 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && 2228 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel &&
2196 wdata->win->pending.min) 2229 wdata->win->pending.min)
2197 { 2230 {
2198 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, 2231 ww = ee->prop.min.w + fw;
2199 ee->prop.min.w + fw, 2232 hh = ee->prop.min.h + fh;
2200 ee->prop.min.h + fh); 2233 if (ww < 1) ww = 1;
2234 if (hh < 1) hh = 1;
2235 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ww, hh);
2201 wdata->win->pending.min = 0; 2236 wdata->win->pending.min = 0;
2202 } 2237 }
2203 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && 2238 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel &&
2204 wdata->win->pending.max) 2239 wdata->win->pending.max)
2205 { 2240 {
2206 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, 2241 ww = ee->prop.max.w + fw;
2207 ee->prop.max.w + fw, 2242 hh = ee->prop.max.h + fh;
2208 ee->prop.max.h + fh); 2243 if (ww < 0) ww = 0;
2244 if (hh < 0) hh = 0;
2245 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ww, hh);
2209 wdata->win->pending.max = 0; 2246 wdata->win->pending.max = 0;
2210 } 2247 }
2211 2248