Initial ARGB client support (Rajsekar Manokaran).

SVN revision: 14501
This commit is contained in:
Kim Woelders 2005-04-29 17:37:30 +00:00
parent e42bbce58b
commit 95fc20978b
4 changed files with 56 additions and 3 deletions

View File

@ -228,5 +228,8 @@ Hor
Andreas Volz <andreas.volz@brachttal.net>
Icons in focus list
Rajsekar Manokaran <rajsekar@gmail.com>
Patch for ARGB client support
And others whose names we probably forgot to add (email us and we'll put you
in here)

View File

@ -2263,6 +2263,9 @@ void EventCallbacksProcess(XEvent * ev);
Window ECreateWindow(Window parent, int x, int y, int w, int h,
int saveunder);
Window ECreateVisualWindow(Window parent, int x, int y, int w,
int h, int saveunder,
XWindowAttributes * child_attr);
Window ECreateEventWindow(Window parent, int x, int y, int w,
int h);
Window ECreateFocusWindow(Window parent, int x, int y, int w,

View File

@ -66,7 +66,10 @@ EwinCreate(Window win, int type)
EWin *ewin;
XSetWindowAttributes att;
Window frame;
int require_argb;
XWindowAttributes win_attr;
require_argb = 0;
ewin = Ecalloc(1, sizeof(EWin));
ewin->type = type;
@ -107,7 +110,18 @@ EwinCreate(Window win, int type)
ewin->ewmh.opacity = 0; /* If 0, ignore */
frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
{
Status s = XGetWindowAttributes(disp, win, &win_attr);
if (s != BadDrawable && s != BadWindow && win_attr.depth == 32)
{
frame = ECreateVisualWindow(VRoot.win, -10, -10, 1, 1, 1, &win_attr);
require_argb = 1;
}
else
frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
}
ewin->o.stacked = -1; /* Not placed on desk yet */
EobjInit(&ewin->o, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, NULL);
EoSetDesk(ewin, DesksGetCurrent());
@ -115,7 +129,11 @@ EwinCreate(Window win, int type)
EoSetShadow(ewin, 1);
EobjListFocusAdd(&ewin->o, 0);
ewin->win_container = ECreateWindow(EoGetWin(ewin), 0, 0, 1, 1, 0);
if (require_argb)
ewin->win_container =
ECreateVisualWindow(EoGetWin(ewin), 0, 0, 1, 1, 0, &win_attr);
else
ewin->win_container = ECreateWindow(EoGetWin(ewin), 0, 0, 1, 1, 0);
att.event_mask = EWIN_CONTAINER_EVENT_MASK;
att.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask;
EChangeWindowAttributes(ewin->win_container,

31
src/x.c
View File

@ -266,7 +266,36 @@ ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
else
attr.save_under = False;
win = XCreateWindow(disp, parent, x, y, w, h, 0,
CopyFromParent, InputOutput, CopyFromParent,
VRoot.depth, InputOutput, VRoot.vis,
CWOverrideRedirect | CWSaveUnder | CWBackingStore |
CWColormap | CWBackPixmap | CWBorderPixel, &attr);
EXidSet(win, parent, x, y, w, h, VRoot.depth);
return win;
}
/* Creates a window, but takes the visual, depth and the colormap from c_attr. */
Window
ECreateVisualWindow(Window parent, int x, int y, int w, int h, int saveunder,
XWindowAttributes * c_attr)
{
Window win;
XSetWindowAttributes attr;
attr.backing_store = NotUseful;
attr.override_redirect = True;
attr.border_pixel = 0;
attr.colormap = c_attr->colormap;
/* attr.background_pixel = 0; */
attr.background_pixmap = None;
if ((saveunder == 1) && (Conf.save_under))
attr.save_under = True;
else if (saveunder == 2)
attr.save_under = True;
else
attr.save_under = False;
win = XCreateWindow(disp, parent, x, y, w, h, 0,
c_attr->depth, InputOutput, c_attr->visual,
CWOverrideRedirect | CWSaveUnder | CWBackingStore |
CWColormap | CWBackPixmap | CWBorderPixel, &attr);
EXidSet(win, parent, x, y, w, h, VRoot.depth);