Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: desktops.c icccm.c pager.c Log Message: Scale pagers on screen resolution change. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v retrieving revision 1.221 retrieving revision 1.222 diff -u -3 -r1.221 -r1.222 --- desktops.c 2 Feb 2006 22:34:06 -0000 1.221 +++ desktops.c 11 Feb 2006 12:57:33 -0000 1.222 @@ -1941,6 +1941,8 @@ static void DeskRootResize(int root, int w, int h) { + int ww, hh; + if (EventDebug(EDBUG_TYPE_DESKS)) Eprintf("DeskRootResize %d %dx%d\n", root, w, h); @@ -1963,6 +1965,12 @@ return; EWindowSync(VRoot.win); + + /* Quit if size is not final */ + EGetGeometry(VRoot.win, NULL, NULL, NULL, &ww, &hh, NULL, NULL); + if (w != ww || h != hh) + return; + VRoot.w = w; VRoot.h = h; =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -3 -r1.116 -r1.117 --- icccm.c 7 Jan 2006 07:20:58 -0000 1.116 +++ icccm.c 11 Feb 2006 12:57:34 -0000 1.117 @@ -195,8 +195,8 @@ if (aspect > ewin->icccm.aspect_max) h = (int)((double)w / ewin->icccm.aspect_max); } - i = w / ewin->icccm.w_inc; - j = h / ewin->icccm.h_inc; + i = (w + ewin->icccm.w_inc / 2) / ewin->icccm.w_inc; + j = (h + ewin->icccm.h_inc / 2) / ewin->icccm.h_inc; w = i * ewin->icccm.w_inc; h = j * ewin->icccm.h_inc; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v retrieving revision 1.192 retrieving revision 1.193 diff -u -3 -r1.192 -r1.193 --- pager.c 5 Feb 2006 17:45:24 -0000 1.192 +++ pager.c 11 Feb 2006 12:57:34 -0000 1.193 @@ -69,6 +69,7 @@ Desk *dsk; int w, h; int dw, dh; + int screen_w, screen_h; int update_phase; EWin *ewin; Window sel_win; @@ -465,21 +466,28 @@ } static void -PagerReconfigure(Pager * p) +PagerReconfigure(Pager * p, int apply) { - EWin *ewin; - int ax, ay; + int ax, ay, w, h; double aspect; - ewin = p->ewin; - DesksGetAreaSize(&ax, &ay); + w = (int)(p->w * (double)VRoot.w / p->screen_w); + h = (int)(p->h * (double)VRoot.h / p->screen_h); + p->screen_w = VRoot.w; + p->screen_h = VRoot.h; + aspect = ((double)VRoot.w) / ((double)VRoot.h); - ICCCM_SetSizeConstraints(ewin, 10 * ax, 8 * ay, 320 * ax, 240 * ay, - 0, 0, 4 * ax, 8 * ay, - aspect * ((double)ax / (double)ay), - aspect * ((double)ax / (double)ay)); + ICCCM_SetSizeConstraints(p->ewin, + VRoot.w / 64 * ax, VRoot.h / 64 * ay, + VRoot.w / 4 * ax, VRoot.h / 4 * ay, + 0, 0, 8 * ax, (int)(8 / aspect * ay), + aspect * ((double)ax / (double)ay) - .1, + aspect * ((double)ax / (double)ay) + .1); + + if (apply) + EwinResize(p->ewin, w, h); } static void @@ -642,8 +650,10 @@ return; p->ewin = ewin; + p->screen_w = VRoot.w; + p->screen_h = VRoot.h; - PagerReconfigure(p); + PagerReconfigure(p, 0); ewin->client.event_mask |= ButtonPressMask | ButtonReleaseMask | PointerMotionMask; @@ -1642,7 +1652,7 @@ static void PagersReconfigure(void) { - Pager **pl, *p; + Pager **pl; int i, num; if (!Conf_pagers.enable) @@ -1653,11 +1663,8 @@ return; for (i = 0; i < num; i++) - { - p = pl[i]; - PagerReconfigure(p); - EwinResize(p->ewin, p->ewin->client.w, p->ewin->client.h); - } + PagerReconfigure(pl[i], 1); + Efree(pl); } ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs