New ARGB client handling mode: off(default), borderless, or full.

SVN revision: 14581
This commit is contained in:
Kim Woelders 2005-05-03 18:21:40 +00:00
parent 992fa8754d
commit 55009989fa
3 changed files with 24 additions and 5 deletions

View File

@ -974,7 +974,7 @@ typedef struct
char memory_paranoia;
char save_under;
int edge_flip_resistance;
char argb_clients_borderless;
char argb_client_mode;
/* Not used */
#ifdef HAS_XINERAMA

View File

@ -172,6 +172,26 @@ static void ECompMgrDamageAll(void);
static void ECompMgrHandleRootEvent(XEvent * ev, void *prm);
static void ECompMgrHandleWindowEvent(XEvent * ev, void *prm);
/*
* Visuals
*/
int
EVisualIsARGB(Visual * vis)
{
XRenderPictFormat *pictfmt;
pictfmt = XRenderFindVisualFormat(disp, vis);
if (!pictfmt)
return 0;
#if 0
Eprintf("Visual ID=%#lx Type=%d, alphamask=%d\n", vis->visualid,
pictfmt->type, pictfmt->direct.alphaMask);
#endif
return pictfmt->type == PictTypeDirect && pictfmt->direct.alphaMask;
}
/*
* Regions
*/
@ -894,9 +914,7 @@ void
ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity)
{
ECmWinInfo *cw = eo->cmhook;
Display *dpy = disp;
int mode;
XRenderPictFormat *pictfmt;
if (!cw || cw->opacity == opacity)
return;
@ -914,8 +932,7 @@ ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity)
/* Invalidate stuff changed by opacity */
ECompMgrWinInvalidate(eo, INV_OPACITY);
pictfmt = XRenderFindVisualFormat(dpy, cw->a.visual);
if (pictfmt && pictfmt->type == PictTypeDirect && pictfmt->direct.alphaMask)
if (EVisualIsARGB(cw->a.visual))
mode = WINDOW_ARGB;
else if (cw->opacity != OPAQUE)
mode = WINDOW_TRANS;

View File

@ -31,6 +31,8 @@ typedef struct
int shadow;
} cfg_composite;
int EVisualIsARGB(Visual * vis);
void ECompMgrParseArgs(const char *args);
void ECompMgrWinNew(EObj * eo);