From 4bba9df22b1410af1ef5d71dc61dd9befd790bc1 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sun, 10 Jan 2010 17:17:02 +0000 Subject: [PATCH] Move EWindowGetNamePixmap() to x.c (and rename). SVN revision: 45016 --- src/ecompmgr.c | 16 ++-------------- src/x.c | 14 ++++++++++++++ src/xwin.h | 2 ++ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/ecompmgr.c b/src/ecompmgr.c index d1fbbb1d..36edd36b 100644 --- a/src/ecompmgr.c +++ b/src/ecompmgr.c @@ -875,18 +875,6 @@ ECompMgrWinSetShape(EObj * eo) ERegionShow("shape", cw->shape, NULL); } -static Pixmap -EWindowGetNamePixmap(const struct _xwin *win) -{ - XWindowAttributes xwa; - - if (XGetWindowAttributes(disp, win->xwin, &xwa) == 0 || - xwa.map_state == IsUnmapped) - return None; - - return XCompositeNameWindowPixmap(disp, WinGetXwin(win)); -} - Pixmap ECompMgrWinGetPixmap(const EObj * eo) { @@ -901,7 +889,7 @@ ECompMgrWinGetPixmap(const EObj * eo) if (eo->noredir) return None; - cw->pixmap = EWindowGetNamePixmap(EobjGetWin(eo)); + cw->pixmap = EWindowGetPixmap(EobjGetWin(eo)); return cw->pixmap; } @@ -1189,7 +1177,7 @@ ECompMgrWinSetPicts(EObj * eo) if (cw->pixmap == None && eo->shown && !eo->noredir && (Mode_compmgr.use_pixmap || (eo->fade && Conf_compmgr.fading.enable))) { - cw->pixmap = EWindowGetNamePixmap(EobjGetWin(eo)); + cw->pixmap = EWindowGetPixmap(EobjGetWin(eo)); D2printf("ECompMgrWinSetPicts %#lx: Pmap=%#lx\n", EobjGetXwin(eo), cw->pixmap); } diff --git a/src/x.c b/src/x.c index 3e19d108..7ed51e5b 100644 --- a/src/x.c +++ b/src/x.c @@ -1922,6 +1922,20 @@ EGetTimestamp(void) #if USE_COMPOSITE +#include + +Pixmap +EWindowGetPixmap(const Win win) +{ + XWindowAttributes xwa; + + if (XGetWindowAttributes(disp, win->xwin, &xwa) == 0 || + xwa.map_state == IsUnmapped) + return None; + + return XCompositeNameWindowPixmap(disp, WinGetXwin(win)); +} + /* * Pictures */ diff --git a/src/xwin.h b/src/xwin.h index 88370737..7766f777 100644 --- a/src/xwin.h +++ b/src/xwin.h @@ -324,6 +324,8 @@ Picture EPictureCreateSolid(Window xwin, int argb, Picture EPictureCreateBuffer(Win win, int w, int h, Pixmap * ppmap); void EPictureSetClip(Picture pict, XserverRegion clip); +Pixmap EWindowGetPixmap(const Win win); + #endif /* USE_COMPOSITE */ #endif /* _XWIN_H_ */