Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: ecompmgr.c Log Message: Scale shadow opacity with window opacity, cleanups. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ecompmgr.c 1 Jan 2005 17:58:46 -0000 1.3 +++ ecompmgr.c 4 Jan 2005 19:20:09 -0000 1.4 @@ -183,8 +183,6 @@ #define WINDOW_TRANS 1 #define WINDOW_ARGB 2 -#define TRANS_OPACITY 0.75 - static void ECompMgrDamageAll(void); static void ECompMgrHandleRootEvent(XEvent * ev, void *prm); static void ECompMgrHandleWindowEvent(XEvent * ev, void *prm); @@ -889,7 +887,7 @@ double opacity = SHADOW_OPACITY; if (w->mode == WINDOW_TRANS) - opacity = opacity * TRANS_OPACITY; + opacity *= ((double)w->opacity) / OPAQUE; w->shadow = shadow_picture(dpy, opacity, w->a.width + w->a.border_width * 2, @@ -967,12 +965,6 @@ if (!w) return; - if ((what & (INV_GEOM | INV_SHADOW)) && w->extents != None) - { - XFixesDestroyRegion(dpy, w->extents); - w->extents = None; - } - #if HAS_NAME_WINDOW_PIXMAP if ((what & INV_SIZE) && w->pixmap != None) { @@ -1005,10 +997,11 @@ } #if ENABLE_SHADOWS - if ((what & (INV_SIZE | INV_SHADOW)) && w->shadow != None) + if ((what & (INV_SIZE | INV_OPACITY | INV_SHADOW)) && w->shadow != None) { XRenderFreePicture(dpy, w->shadow); w->shadow = None; + what |= INV_GEOM; } if ((what & (INV_SIZE | INV_OPACITY | INV_SHADOW)) && w->shadowPict != None) { @@ -1016,6 +1009,12 @@ w->shadowPict = None; } #endif + + if ((what & (INV_GEOM | INV_SHADOW)) && w->extents != None) + { + ECompMgrDamageMerge(w->extents, 1); + w->extents = None; + } } void @@ -1037,6 +1036,10 @@ /* Invalidate stuff changed by opacity */ ECompMgrWinInvalidate(eo, INV_OPACITY); + /* Extents may be unchanged, however, we must repaint */ + if (w->extents != None) + ECompMgrDamageMerge(w->extents, 0); + if (w->a.class == InputOnly) pictfmt = NULL; else @@ -1049,9 +1052,6 @@ else mode = WINDOW_SOLID; w->mode = mode; - - if (w->extents != None) - ECompMgrDamageMerge(w->extents, 0); } static void @@ -1241,12 +1241,12 @@ PropertyChangeMask /* | StructureNotifyMask */ ); #endif - /* Find new window region */ - w->extents = win_extents(disp, eo); - w->opacity = 0xdeadbeef; ECompMgrWinChangeOpacity(eo, eo->opacity); + /* Find new window region */ + w->extents = win_extents(disp, eo); + EventCallbackRegister(eo->win, 0, ECompMgrHandleWindowEvent, eo); #if 0 @@ -1327,8 +1327,6 @@ if (!gone) finish_unmap_win(eo); - else - ECompMgrDamageMerge(w->extents, 0); ECompMgrWinInvalidate(eo, INV_ALL); @@ -1588,8 +1586,10 @@ 0, 0, 0, 0, w->rcx, w->rcy, w->rcw, w->rch); break; } +#if 0 XFixesDestroyRegion(dpy, w->borderClip); w->borderClip = None; +#endif } static void ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs