From d4d784e56e3af798f97b3367f9b74fbb03ad5d9f Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Wed, 26 Aug 2020 12:22:12 +0100 Subject: [PATCH] pager: Fix pager sizing/resizing when on the desktop. Adding a pager to the background/desktop caused some issues for users. This resolves the issue, whilst trying to remain readable. @fix --- src/modules/pager/e_mod_main.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index 4945eb4b6..e13733354 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -332,12 +332,30 @@ _pager_recalc(void *data) Pager_Desk *pd; Evas_Coord mw = 0, mh = 0; int w, h, zw, zh, w2, h2; + E_Gadcon_Orient orient; + Eina_Bool shelf = 1; + + if (!p->inst || !p->inst->gcc || !p->inst->gcc->gadcon) return; p->recalc = NULL; zw = p->zone->w; zh = p->zone->h; pd = eina_list_data_get(p->desks); if (!pd) return; + orient = p->inst->gcc->gadcon->orient; + switch (orient) + { + case E_GADCON_ORIENT_FLOAT: + case E_GADCON_ORIENT_VERT: + case E_GADCON_ORIENT_HORIZ: + shelf = 0; + break; + default: + break; + } + + if (!shelf) return; + edje_object_size_min_calc(pd->o_desk, &mw, &mh); evas_object_geometry_get(pd->o_desk, NULL, NULL, &w, &h); w -= mw; h -= mh; @@ -348,14 +366,12 @@ _pager_recalc(void *data) } w = w2; h = h2; w += mw; h += mh; - if ((p->inst) && (p->inst->gcc)) - { - if (p->invert) - e_gadcon_client_aspect_set(p->inst->gcc, p->ynum * w, p->xnum * h); - else - e_gadcon_client_aspect_set(p->inst->gcc, p->xnum * w, p->ynum * h); - _aspect(p->inst->gcc); - } + + if (p->invert) + e_gadcon_client_aspect_set(p->inst->gcc, p->ynum * w, p->xnum * h); + else + e_gadcon_client_aspect_set(p->inst->gcc, p->xnum * w, p->ynum * h); + _aspect(p->inst->gcc); } static void