summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-01-17 22:24:26 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-01-18 00:14:58 +0000
commitde4a698c9674422cfa1e633197ee80b4b0e72aef (patch)
tree80b56bc53e143bb00ed079be0a2676fbb83aca27 /src/modules
parent28aa1a65b695362d2ae8f5caf905f6d3c0fd663e (diff)
elm win + ecore evas - fix csd stuff like base size and min sizing
this fixes a lot that was broken with csd... but not everything. @fix
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c58
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c20
2 files changed, 44 insertions, 34 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 ad922474cd..c14bdbcd33 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
@@ -313,7 +313,7 @@ static void
313_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h) 313_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
314{ 314{
315 Ecore_Evas_Engine_Wl_Data *wdata; 315 Ecore_Evas_Engine_Wl_Data *wdata;
316 int ow, oh, ew, eh; 316 int ow, oh, ew, eh, fw, fh;
317 int diff = 0; 317 int diff = 0;
318 318
319 LOGFN(__FILE__, __LINE__, __FUNCTION__); 319 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -326,6 +326,8 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
326 ee->req.w = w; 326 ee->req.w = w;
327 ee->req.h = h; 327 ee->req.h = h;
328 328
329 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
330
329 /* TODO: wayland client can resize the ecore_evas directly. 331 /* TODO: wayland client can resize the ecore_evas directly.
330 * In the future, we will remove ee->req value in wayland backend */ 332 * In the future, we will remove ee->req value in wayland backend */
331 ew = ee->w; 333 ew = ee->w;
@@ -335,55 +337,52 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
335 337
336 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min) 338 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min)
337 { 339 {
338 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h); 340 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh);
339 wdata->win->pending.min = 0; 341 wdata->win->pending.min = 0;
340 } 342 }
341 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max) 343 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max)
342 { 344 {
343 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h); 345 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh);
344 wdata->win->pending.max = 0; 346 wdata->win->pending.max = 0;
345 } 347 }
346 348
347 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min) 349 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
348 { 350 {
349 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h); 351 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh);
350 wdata->win->pending.min = 0; 352 wdata->win->pending.min = 0;
351 } 353 }
352 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max) 354 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max)
353 { 355 {
354 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h); 356 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh);
355 wdata->win->pending.max = 0; 357 wdata->win->pending.max = 0;
356 } 358 }
357 359
358 if (!ee->prop.fullscreen) 360 if (!ee->prop.fullscreen)
359 { 361 {
360 int fw = 0, fh = 0;
361 int maxw = 0, maxh = 0; 362 int maxw = 0, maxh = 0;
362 int minw = 0, minh = 0; 363 int minw = 0, minh = 0;
363 364
364 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
365
366 if (ECORE_EVAS_PORTRAIT(ee)) 365 if (ECORE_EVAS_PORTRAIT(ee))
367 { 366 {
368 if (ee->prop.min.w > 0) 367 if (ee->prop.min.w > 0)
369 minw = (ee->prop.min.w - fw); 368 minw = (ee->prop.min.w);
370 if (ee->prop.min.h > 0) 369 if (ee->prop.min.h > 0)
371 minh = (ee->prop.min.h - fh); 370 minh = (ee->prop.min.h);
372 if (ee->prop.max.w > 0) 371 if (ee->prop.max.w > 0)
373 maxw = (ee->prop.max.w + fw); 372 maxw = (ee->prop.max.w);
374 if (ee->prop.max.h > 0) 373 if (ee->prop.max.h > 0)
375 maxh = (ee->prop.max.h + fh); 374 maxh = (ee->prop.max.h);
376 } 375 }
377 else 376 else
378 { 377 {
379 if (ee->prop.min.w > 0) 378 if (ee->prop.min.w > 0)
380 minw = (ee->prop.min.w - fh); 379 minw = (ee->prop.min.w);
381 if (ee->prop.min.h > 0) 380 if (ee->prop.min.h > 0)
382 minh = (ee->prop.min.h - fw); 381 minh = (ee->prop.min.h);
383 if (ee->prop.max.w > 0) 382 if (ee->prop.max.w > 0)
384 maxw = (ee->prop.max.w + fh); 383 maxw = (ee->prop.max.w);
385 if (ee->prop.max.h > 0) 384 if (ee->prop.max.h > 0)
386 maxh = (ee->prop.max.h + fw); 385 maxh = (ee->prop.max.h);
387 } 386 }
388 387
389 if ((maxw > 0) && (w > maxw)) 388 if ((maxw > 0) && (w > maxw))
@@ -401,13 +400,13 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
401 /* calc new size using base size & step size */ 400 /* calc new size using base size & step size */
402 if (ee->prop.step.w > 1) 401 if (ee->prop.step.w > 1)
403 { 402 {
404 int bw = ee->prop.base.w ?: minw; 403 int bw = ee->prop.base.w;
405 w = (bw + (((w - bw) / ee->prop.step.w) * ee->prop.step.w)); 404 w = (bw + (((w - bw) / ee->prop.step.w) * ee->prop.step.w));
406 } 405 }
407 406
408 if (ee->prop.step.h > 1) 407 if (ee->prop.step.h > 1)
409 { 408 {
410 int bh = ee->prop.base.h ?: minh; 409 int bh = ee->prop.base.h;
411 h = (bh + (((h - bh) / ee->prop.step.h) * ee->prop.step.h)); 410 h = (bh + (((h - bh) / ee->prop.step.h) * ee->prop.step.h));
412 } 411 }
413 412
@@ -1671,6 +1670,7 @@ _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *
1671static void 1670static void
1672_ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h) 1671_ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
1673{ 1672{
1673 int fw, fh;
1674 Ecore_Evas_Engine_Wl_Data *wdata; 1674 Ecore_Evas_Engine_Wl_Data *wdata;
1675 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1675 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1676 1676
@@ -1682,14 +1682,15 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
1682 ee->prop.min.w = w; 1682 ee->prop.min.w = w;
1683 ee->prop.min.h = h; 1683 ee->prop.min.h = h;
1684 wdata = ee->engine.data; 1684 wdata = ee->engine.data;
1685 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
1685 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel) 1686 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel)
1686 { 1687 {
1687 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, w, h); 1688 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, w + fw, h + fh);
1688 wdata->win->pending.min = 0; 1689 wdata->win->pending.min = 0;
1689 } 1690 }
1690 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel) 1691 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel)
1691 { 1692 {
1692 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h); 1693 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w + fw, h + fh);
1693 wdata->win->pending.min = 0; 1694 wdata->win->pending.min = 0;
1694 } 1695 }
1695 else 1696 else
@@ -1700,6 +1701,7 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
1700static void 1701static void
1701_ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h) 1702_ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
1702{ 1703{
1704 int fw, fh;
1703 Ecore_Evas_Engine_Wl_Data *wdata; 1705 Ecore_Evas_Engine_Wl_Data *wdata;
1704 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1706 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1705 1707
@@ -1710,14 +1712,15 @@ _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
1710 ee->prop.max.w = w; 1712 ee->prop.max.w = w;
1711 ee->prop.max.h = h; 1713 ee->prop.max.h = h;
1712 wdata = ee->engine.data; 1714 wdata = ee->engine.data;
1715 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
1713 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel) 1716 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel)
1714 { 1717 {
1715 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, w, h); 1718 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, w + fw, h + fh);
1716 wdata->win->pending.max = 0; 1719 wdata->win->pending.max = 0;
1717 } 1720 }
1718 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel) 1721 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel)
1719 { 1722 {
1720 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h); 1723 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w + fw, h + fh);
1721 wdata->win->pending.max = 0; 1724 wdata->win->pending.max = 0;
1722 } 1725 }
1723 else 1726 else
@@ -2153,31 +2156,30 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
2153 { 2156 {
2154 int fw, fh; 2157 int fw, fh;
2155 2158
2159 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
2156 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min) 2160 if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min)
2157 { 2161 {
2158 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h); 2162 wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh);
2159 wdata->win->pending.min = 0; 2163 wdata->win->pending.min = 0;
2160 } 2164 }
2161 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max) 2165 if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max)
2162 { 2166 {
2163 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h); 2167 wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh);
2164 wdata->win->pending.max = 0; 2168 wdata->win->pending.max = 0;
2165 } 2169 }
2166 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min) 2170 if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
2167 { 2171 {
2168 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h); 2172 wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh);
2169 wdata->win->pending.min = 0; 2173 wdata->win->pending.min = 0;
2170 } 2174 }
2171 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max) 2175 if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max)
2172 { 2176 {
2173 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h); 2177 wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh);
2174 wdata->win->pending.max = 0; 2178 wdata->win->pending.max = 0;
2175 } 2179 }
2176 2180
2177 _ecore_evas_wayland_window_update(ee, wdata, ee->alpha); 2181 _ecore_evas_wayland_window_update(ee, wdata, ee->alpha);
2178 2182
2179 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
2180
2181 ecore_wl2_window_show(wdata->win); 2183 ecore_wl2_window_show(wdata->win);
2182 einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas); 2184 einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
2183 if (einfo) 2185 if (einfo)
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 97e5fb2d10..abea314d33 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -1534,6 +1534,8 @@ _ecore_evas_x_shadow_update(Ecore_Evas *ee)
1534 ECORE_X_ATOM_CARDINAL, 32, shadow, 4); 1534 ECORE_X_ATOM_CARDINAL, 32, shadow, 4);
1535} 1535}
1536 1536
1537static void _ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee);
1538
1537static Eina_Bool 1539static Eina_Bool
1538_ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) 1540_ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
1539{ 1541{
@@ -1672,6 +1674,8 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE
1672 } 1674 }
1673 } 1675 }
1674 } 1676 }
1677 if (framespace_resized)
1678 _ecore_evas_x_size_pos_hints_update(ee);
1675 } 1679 }
1676 return ECORE_CALLBACK_PASS_ON; 1680 return ECORE_CALLBACK_PASS_ON;
1677} 1681}
@@ -1763,15 +1767,19 @@ _ecore_evas_x_event_window_hide(void *data EINA_UNUSED, int type EINA_UNUSED, vo
1763static void 1767static void
1764_ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee) 1768_ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee)
1765{ 1769{
1770 int fw, fh;
1771
1772 fw = ee->framespace.w;
1773 fh = ee->framespace.h;
1766 ecore_x_icccm_size_pos_hints_set(ee->prop.window, 1774 ecore_x_icccm_size_pos_hints_set(ee->prop.window,
1767 ee->prop.request_pos /*request_pos */, 1775 ee->prop.request_pos /*request_pos */,
1768 ECORE_X_GRAVITY_NW /* gravity */, 1776 ECORE_X_GRAVITY_NW /* gravity */,
1769 ee->prop.min.w /* min_w */, 1777 ee->prop.min.w + fw /* min_w */,
1770 ee->prop.min.h /* min_h */, 1778 ee->prop.min.h + fh /* min_h */,
1771 ee->prop.max.w /* max_w */, 1779 ee->prop.max.w + fw /* max_w */,
1772 ee->prop.max.h /* max_h */, 1780 ee->prop.max.h + fh /* max_h */,
1773 ee->prop.base.w /* base_w */, 1781 ee->prop.base.w + fw /* base_w */,
1774 ee->prop.base.h /* base_h */, 1782 ee->prop.base.h + fh /* base_h */,
1775 ee->prop.step.w /* step_x */, 1783 ee->prop.step.w /* step_x */,
1776 ee->prop.step.h /* step_y */, 1784 ee->prop.step.h /* step_y */,
1777 ee->prop.aspect /* min_aspect */, 1785 ee->prop.aspect /* min_aspect */,