Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: ecompmgr.c emodule.h pager.c Log Message: Avoid unnecessary use of timers in pagers in live update mode. =================================================================== RCS file: /cvs/e/e16/e/src/ecompmgr.c,v retrieving revision 1.165 retrieving revision 1.166 diff -u -3 -r1.165 -r1.166 --- ecompmgr.c 30 Sep 2007 15:47:34 -0000 1.165 +++ ecompmgr.c 26 Jan 2008 11:45:33 -0000 1.166 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Kim Woelders + * Copyright (C) 2004-2008 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -1868,6 +1868,9 @@ } eo->serial = ev->xany.serial; ECompMgrDamageMergeObject(eo, parts); + + if (eo->type == EOBJ_TYPE_EWIN) + ModulesSignal(ESIGNAL_EWIN_DAMAGE, eo); } static void =================================================================== RCS file: /cvs/e/e16/e/src/emodule.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- emodule.h 18 May 2007 08:25:02 -0000 1.12 +++ emodule.h 26 Jan 2008 11:45:33 -0000 1.13 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2007 Kim Woelders + * Copyright (C) 2003-2008 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -60,6 +60,7 @@ ESIGNAL_EWIN_DEICONIFY, ESIGNAL_EWIN_CHANGE_ICON, ESIGNAL_EWIN_CHANGE, + ESIGNAL_EWIN_DAMAGE, ESIGNAL_THEME_TRANS_CHANGE, } e_signal_t; =================================================================== RCS file: /cvs/e/e16/e/src/pager.c,v retrieving revision 1.255 retrieving revision 1.256 diff -u -3 -r1.255 -r1.256 --- pager.c 26 Jan 2008 11:44:02 -0000 1.255 +++ pager.c 26 Jan 2008 11:45:33 -0000 1.256 @@ -77,6 +77,7 @@ int zoom; Idler *idler; char update_pending; + char timer_pending; } Mode_pagers; typedef struct @@ -104,13 +105,11 @@ static void PagerScanCancel(Pager * p); static void PagerScanTimeout(int val, void *data); -static void PagerUpdateTimeout(int val, void *data); static void PagerCheckUpdate(Pager * p, void *prm); static void PagerUpdateEwinsFromPager(Pager * p); static void PagerHiwinHide(void); static void PagerEvent(Win win, XEvent * ev, void *prm); static void PagerHiwinEvent(Win win, XEvent * ev, void *prm); -static void doPagerUpdate(Pager * p); static Ecore_List *pager_list = NULL; @@ -202,7 +201,7 @@ static int offsets[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; int pager_mode = PagersGetMode(); - if (pager_mode == PAGER_MODE_SIMPLE) + if (pager_mode != PAGER_MODE_SNAP) return; p = (Pager *) data; @@ -211,13 +210,10 @@ ewin = p->ewin; if (!ewin || !EoIsShown(ewin)) return; - if (pager_mode == PAGER_MODE_SNAP) - { - if (p->dsk != DesksGetCurrent()) - return; - if (ewin->state.visibility == VisibilityFullyObscured) - return; - } + if (p->dsk != DesksGetCurrent()) + return; + if (ewin->state.visibility == VisibilityFullyObscured) + return; if (Conf_pagers.scanspeed > 0) PagerScanTrig(p); @@ -225,12 +221,6 @@ if (Mode.mode != MODE_NONE) return; - if (pager_mode == PAGER_MODE_LIVE) - { - doPagerUpdate(p); - return; - } - DeskCurrentGetArea(&cx, &cy); ww = p->dw; hh = p->dh; @@ -508,11 +498,6 @@ p->do_update = 1; Mode_pagers.update_pending = 1; - - if (PagersGetMode() == PAGER_MODE_SIMPLE) - return; - - DoIn("pg-upd", .2, PagerUpdateTimeout, 0, NULL); } static void @@ -826,23 +811,37 @@ } static void +_PagersUpdateTimeout(int val __UNUSED__, void *data __UNUSED__) +{ + Mode_pagers.timer_pending = 0; +} + +static void PagersCheckUpdate(void) { + static double tlast = 0.; + double t; + if (!Mode_pagers.update_pending || !Conf_pagers.enable) return; + t = GetTime(); + if (t - tlast < .05) + { + /* The purpose of this timer is to trigger the idler */ + if (!Mode_pagers.timer_pending) + DoIn("pg-upd", .1, _PagersUpdateTimeout, 0, NULL); + Mode_pagers.timer_pending = 1; + return; + } + tlast = t; + PagersForeach(NULL, PagerCheckUpdate, NULL); Mode_pagers.update_pending = 0; } static void -PagerUpdateTimeout(int val __UNUSED__, void *data __UNUSED__) -{ - PagersCheckUpdate(); -} - -static void _PagersIdler(void *data __UNUSED__) { PagersCheckUpdate(); @@ -914,18 +913,32 @@ } static void -PagersUpdateEwin(EWin * ewin, int gone) +PagersUpdateEwin(EWin * ewin, int why) { Desk *dsk; if (!Conf_pagers.enable) return; - if (!gone && (!EoIsShown(ewin) || ewin->state.animated)) - return; + switch (why) + { + case 0: /* Change */ + if (!EoIsShown(ewin) || ewin->state.animated) + return; + break; + + case 1: /* Gone */ + if (ewin == HiwinGetEwin(hiwin, 0)) + PagerHiwinHide(); + break; - if (gone && ewin == HiwinGetEwin(hiwin, 0)) - PagerHiwinHide(); + case 2: /* Damage */ + if (ewin->type == EWIN_TYPE_PAGER) + return; + if (PagersGetMode() != PAGER_MODE_LIVE) + return; + break; + } dsk = (EoIsFloating(ewin)) ? DesksGetCurrent() : EoGetDesk(ewin); PagersUpdate(dsk, EwinGetVX(ewin), EwinGetVY(ewin), @@ -1279,7 +1292,7 @@ PagersUpdateBackground(NULL); - if (Conf_pagers.mode != PAGER_MODE_SIMPLE && Conf_pagers.scanspeed > 0) + if (Conf_pagers.mode == PAGER_MODE_SNAP && Conf_pagers.scanspeed > 0) PagersForeach(DesksGetCurrent(), _PagerSetSnap, NULL); autosave(); @@ -2033,6 +2046,9 @@ break; case ESIGNAL_EWIN_CHANGE: PagersUpdateEwin((EWin *) prm, 0); + break; + case ESIGNAL_EWIN_DAMAGE: + PagersUpdateEwin((EWin *) prm, 2); break; } } ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs