void bar_init(WMScreen *s) { WinAttr wa; if(s->barwin) { bar_resize(s); return; } s->brect = s->r; s->brect.min.y = s->brect.max.y - labelh(def.font); wa.override_redirect = 1; wa.background_pixmap = ParentRelative; wa.event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | FocusChangeMask; s->barwin = createwindow(&scr.root, s->brect, scr.depth, InputOutput, &wa, CWOverrideRedirect | CWBackPixmap | CWEventMask); s->barwin->aux = s; xdnd_initwindow(s->barwin); sethandler(s->barwin, &handlers); if(s == screens[0]) mapwin(s->barwin); }
static Window* gethsep(Rectangle r) { Window *w; WinAttr wa; wa.background_pixel = pixelvalue(&scr.root, &def.normcolor.border); w = createwindow(&scr.root, r, scr.depth, InputOutput, &wa, CWBackPixel); mapwin(w); raisewin(w); return w; }
Window* constraintwin(Rectangle r) { Window *w; w = createwindow(&scr.root, r, 0, InputOnly, nil, 0); if(0) { Window *w2; w2 = createwindow(&scr.root, r, 0, InputOutput, nil, 0); selectinput(w2, ExposureMask); w->aux = w2; setborder(w2, 1, &def.focuscolor.border); sethandler(w2, &chandler); mapwin(w2); raisewin(w2); } mapwin(w); return w; }