X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=5c25c2426c6d18ec3ddffbd135d903afafa17e8b;hp=31fad43a0dcf1b8f3a0d70dfd9b23ab3290f16d9;hb=99144036af9457eb08c709d3fba7f6ffb42039dc;hpb=30f405da4e8932b91d3b27dbe3da794e2eaab2a7 diff --git a/dwm.c b/dwm.c index 31fad43..5c25c24 100644 --- a/dwm.c +++ b/dwm.c @@ -273,11 +273,11 @@ static void window_set_opaque(Client *c); 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); } @@ -798,10 +798,6 @@ focus(Client *c) { /* 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; @@ -819,8 +815,8 @@ focus(Client *c) { } selmon->sel = c; drawbars(); - if(c) - window_set_translucent(c); + if(c && (!root || (c->win!=root)) ) + window_set_opaque(c); } void @@ -851,7 +847,14 @@ focusstack(const Arg *arg) { if(!selmon->sel) return; - if(arg->i > 0) { + if(arg->i == 0) { + for(i = selmon->clients; i != selmon->sel; i = i->next) { + if(ISVISIBLE(i)) { + c = i; + break; + } + } + } else if(arg->i > 0) { for(c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); if(!c) for(c = selmon->clients; c && !ISVISIBLE(c); c = c->next); @@ -1705,6 +1708,8 @@ 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) {