Index: openbox/client.c =================================================================== RCS file: /cvs/cvsroot/openbox/openbox/client.c,v retrieving revision 1.372 diff -p -u -d -p -u -d -r1.372 client.c --- openbox/client.c 22 Aug 2006 16:37:34 -0000 1.372 +++ openbox/client.c 25 Aug 2006 18:25:17 -0000 @@ -311,7 +311,7 @@ void client_manage(Window window) XChangeSaveSet(ob_display, window, SetModeInsert); /* create the decoration frame for the client window */ - self->frame = frame_new(); + self->frame = frame_new(window); frame_grab_client(self->frame, self); Index: openbox/frame.c =================================================================== RCS file: /cvs/cvsroot/openbox/openbox/frame.c,v retrieving revision 1.66 diff -p -u -d -p -u -d -r1.66 frame.c --- openbox/frame.c 22 Aug 2006 16:37:34 -0000 1.66 +++ openbox/frame.c 25 Aug 2006 18:25:17 -0000 @@ -47,59 +47,79 @@ static gboolean flash_timeout(gpointer d static void set_theme_statics(ObFrame *self); static void free_theme_statics(ObFrame *self); -static Window createWindow(Window parent, gulong mask, - XSetWindowAttributes *attrib) +static Window createWindow(Window parent, gint depth, Visual * vis, + gulong mask, XSetWindowAttributes *attrib) { + if (!depth) depth = RrDepth(ob_rr_inst); + if (!vis) vis = RrVisual(ob_rr_inst); return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0, - RrDepth(ob_rr_inst), InputOutput, - RrVisual(ob_rr_inst), mask, attrib); + depth, InputOutput, + vis, mask, attrib); } -ObFrame *frame_new() +ObFrame *frame_new(Window client) { XSetWindowAttributes attrib; - gulong mask; + gulong mask = 0; ObFrame *self; + /* for those argb (or is it rgba) visuals */ + XWindowAttributes client_attrib; + Status s; + gint depth = 0; + Visual * vis = NULL; + XVisualInfo vis_info; + self = g_new0(ObFrame, 1); self->obscured = TRUE; /* create all of the decor windows */ - mask = CWEventMask; + mask = CWEventMask | CWBorderPixel | CWBackPixel; attrib.event_mask = FRAME_EVENTMASK; - self->window = createWindow(RootWindow(ob_display, ob_screen), - mask, &attrib); + attrib.background_pixel = 0; + attrib.border_pixel = 0; - mask = 0; - self->plate = createWindow(self->window, mask, &attrib); + if (client) { + s = XGetWindowAttributes(ob_display, client, &client_attrib); + if (s != BadDrawable && s != BadWindow && client_attrib.depth == 32) { + attrib.colormap = client_attrib.colormap; + mask |= CWColormap; + vis = client_attrib.visual; + depth = client_attrib.depth; + } + } + + self->window = createWindow(RootWindow(ob_display, ob_screen), depth, + vis, mask, &attrib); + + self->plate = createWindow(self->window, depth, vis, mask, &attrib); - mask = CWEventMask; attrib.event_mask = ELEMENT_EVENTMASK; - self->title = createWindow(self->window, mask, &attrib); + self->title = createWindow(self->window, depth, vis, mask, &attrib); mask |= CWCursor; attrib.cursor = ob_cursor(OB_CURSOR_NORTHWEST); - self->tlresize = createWindow(self->title, mask, &attrib); + self->tlresize = createWindow(self->title, depth, vis, mask, &attrib); attrib.cursor = ob_cursor(OB_CURSOR_NORTHEAST); - self->trresize = createWindow(self->title, mask, &attrib); + self->trresize = createWindow(self->title, depth, vis, mask, &attrib); mask &= ~CWCursor; - self->label = createWindow(self->title, mask, &attrib); - self->max = createWindow(self->title, mask, &attrib); - self->close = createWindow(self->title, mask, &attrib); - self->desk = createWindow(self->title, mask, &attrib); - self->shade = createWindow(self->title, mask, &attrib); - self->icon = createWindow(self->title, mask, &attrib); - self->iconify = createWindow(self->title, mask, &attrib); - self->handle = createWindow(self->window, mask, &attrib); + self->label = createWindow(self->title, depth, vis, mask, &attrib); + self->max = createWindow(self->title, depth, vis, mask, &attrib); + self->close = createWindow(self->title, depth, vis, mask, &attrib); + self->desk = createWindow(self->title, depth, vis, mask, &attrib); + self->shade = createWindow(self->title, depth, vis, mask, &attrib); + self->icon = createWindow(self->title, depth, vis, mask, &attrib); + self->iconify = createWindow(self->title, depth, vis, mask, &attrib); + self->handle = createWindow(self->window, depth, vis, mask, &attrib); mask |= CWCursor; attrib.cursor = ob_cursor(OB_CURSOR_SOUTHWEST); - self->lgrip = createWindow(self->handle, mask, &attrib); + self->lgrip = createWindow(self->handle, depth, vis, mask, &attrib); attrib.cursor = ob_cursor(OB_CURSOR_SOUTHEAST); - self->rgrip = createWindow(self->handle, mask, &attrib); + self->rgrip = createWindow(self->handle, depth, vis, mask, &attrib); self->focused = FALSE;