static void window_set_translucent(Client *c);
void
window_set_opaque(Client *c) {
- XChangeProperty(dpy, c->win, netatom[NetWMWindowOpacity], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)unfocused_opacity, 1);
+ XDeleteProperty(dpy, c->win, netatom[NetWMWindowOpacity]);
}
void
window_set_translucent(Client *c) {
- XDeleteProperty(dpy, c->win, netatom[NetWMWindowOpacity]);
+ XChangeProperty(dpy, c->win, netatom[NetWMWindowOpacity], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)unfocused_opacity, 1);
}
/* was if(selmon->sel) */
if(selmon->sel && selmon->sel != c)
unfocus(selmon->sel, False);
- if(selmon->sel && c!=selmon->sel && c && (!root || (selmon->sel->win!=root && c->win!=root)) )
- window_set_opaque(selmon->sel);
- if(c && c!=selmon->sel && (!root || (c->win!=root)) )
- window_set_translucent(c);
if(c) {
if(c->mon != selmon)
selmon = c->mon;
}
selmon->sel = c;
drawbars();
- if(c)
- window_set_translucent(c);
+ if(c && (!root || (c->win!=root)) )
+ window_set_opaque(c);
}
void
unfocus(Client *c, Bool setfocus) {
if(!c)
return;
+ if(!root || c->win!=root)
+ window_set_translucent(c);
grabbuttons(c, False);
XSetWindowBorder(dpy, c->win, scheme[SchemeNorm].border->rgb);
if(setfocus) {