diff --git a/src/framewin.c b/src/framewin.c index 2d3c0099..448d204f 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -62,7 +62,8 @@ WFrameWindow *wFrameWindowCreate(WScreen * scr, int wlevel, int x, int y, int width, int height, int *clearance, int *title_min, int *title_max, int flags, WTexture ** title_texture, WTexture ** resize_texture, - WMColor ** color, WMFont ** font) + WMColor ** color, WMFont ** font, + int depth, Visual *visual, Colormap colormap) { WFrameWindow *fwin; @@ -84,8 +85,12 @@ WFrameWindow *wFrameWindowCreate(WScreen * scr, int wlevel, int x, int y, fwin->last_languagemode = XkbGroup2Index; #endif + fwin->depth = depth; + fwin->visual = visual; + fwin->colormap = colormap; + fwin->core = wCoreCreateTopLevel(scr, x, y, width, height, (flags & WFF_BORDER) - ? FRAME_BORDER_WIDTH : 0); + ? FRAME_BORDER_WIDTH : 0, fwin->depth, fwin->visual, fwin->colormap); if (wPreferences.use_saveunders) { unsigned long vmask; XSetWindowAttributes attribs; diff --git a/src/framewin.h b/src/framewin.h index 24b438ce..27e6518a 100644 --- a/src/framewin.h +++ b/src/framewin.h @@ -147,6 +147,9 @@ typedef struct WFrameWindow { unsigned int incomplete_title:1; } flags; + int depth; + Visual *visual; + Colormap colormap; } WFrameWindow; @@ -156,7 +159,8 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, int *title_min, int *title_max, int flags, union WTexture **title_texture, union WTexture **resize_texture, - WMColor **color, WMFont **font); + WMColor **color, WMFont **font, + int depth, Visual *visual, Colormap colormap); void wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags); diff --git a/src/icon.c b/src/icon.c index c4798909..d929a8c7 100644 --- a/src/icon.c +++ b/src/icon.c @@ -187,7 +187,7 @@ static WIcon *wIconCreateCore(WScreen *scr, int coord_x, int coord_y) coord_y, wPreferences.icon_size, wPreferences.icon_size, - 0); + 0, scr->w_depth, scr->w_visual, scr->w_colormap); if (wPreferences.use_saveunders) { vmask = CWSaveUnder; diff --git a/src/menu.c b/src/menu.c index 6231e067..7bb0639d 100644 --- a/src/menu.c +++ b/src/menu.c @@ -164,7 +164,8 @@ WMenu *wMenuCreate(WScreen * screen, char *title, int main_menu) &wPreferences.menu_title_max_height, flags, screen->menu_title_texture, NULL, - screen->menu_title_color, &screen->menu_title_font); + screen->menu_title_color, &screen->menu_title_font, + screen->w_depth, screen->w_visual, screen->w_colormap); menu->frame->core->descriptor.parent = menu; menu->frame->core->descriptor.parent_type = WCLASS_MENU; diff --git a/src/wcore.c b/src/wcore.c index ac896a52..241ede43 100644 --- a/src/wcore.c +++ b/src/wcore.c @@ -46,7 +46,7 @@ extern XContext wWinContext; * The created window. *---------------------------------------------------------------------- */ -WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int height, int bwidth) +WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int height, int bwidth, int depth, Visual *visual, Colormap colormap) { WCoreWindow *core; int vmask; @@ -67,10 +67,10 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int | ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask; vmask |= CWColormap; - attribs.colormap = screen->w_colormap; + attribs.colormap = colormap; core->window = XCreateWindow(dpy, screen->root_win, x, y, width, height, - bwidth, screen->w_depth, CopyFromParent, screen->w_visual, vmask, &attribs); + bwidth, depth, CopyFromParent, visual, vmask, &attribs); core->width = width; core->height = height; core->screen_ptr = screen; @@ -115,10 +115,8 @@ WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int y, int width, int heig attribs.background_pixel = parent->screen_ptr->black_pixel; attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask; - /* - vmask |= CWColormap; - attribs.colormap = parent->screen_ptr->w_colormap; - */ + vmask |= CWColormap; + attribs.colormap = parent->screen_ptr->w_colormap; core->window = XCreateWindow(dpy, parent->window, x, y, width, height, 0, parent->screen_ptr->w_depth, CopyFromParent, diff --git a/src/wcore.h b/src/wcore.h index 8209ba68..34522277 100644 --- a/src/wcore.h +++ b/src/wcore.h @@ -43,7 +43,8 @@ typedef struct _WCoreWindow { WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, - int height, int bwidth); + int height, int bwidth, + int depth, Visual *visual, Colormap colormap); WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, int width, int height); diff --git a/src/window.c b/src/window.c index 50962f70..e7b1036f 100644 --- a/src/window.c +++ b/src/window.c @@ -1094,7 +1094,8 @@ WWindow *wManageWindow(WScreen *scr, Window window) &wPreferences.window_title_max_height, foo, scr->window_title_texture, - scr->resizebar_texture, scr->window_title_color, &scr->title_font); + scr->resizebar_texture, scr->window_title_color, &scr->title_font, + wattribs.depth, wattribs.visual, wattribs.colormap); wwin->frame->flags.is_client_window_frame = 1; wwin->frame->flags.justification = wPreferences.title_justification; @@ -1373,7 +1374,8 @@ WWindow *wManageInternalWindow(WScreen *scr, Window window, Window owner, &wPreferences.window_title_max_height, foo, scr->window_title_texture, - scr->resizebar_texture, scr->window_title_color, &scr->title_font); + scr->resizebar_texture, scr->window_title_color, &scr->title_font, + scr->w_depth, scr->w_visual, scr->w_colormap); XSaveContext(dpy, window, wWinContext, (XPointer) & wwin->client_descriptor);