On Thu, Apr 23, 2009 at 08:41:28PM -0400, Jeremy Jay wrote:
> Aw I was so close on the urgent patch, just missed the Arg ptr.
> Here's a working version:
>
> { MODKEY, XK_u, focusurgent, {0} },
>
> void
> focusurgent(Arg *x) {
> for(c = stack; c && !(c->isurgent); c = c->snext);
> if(sel && sel != c) {
> grabbuttons(sel, False);
> XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
> }
> if(c) {
> Arg a;
> a.ui=c->tags;
> view(&a);
> clearurgent(c);
> detachstack(c);
> attachstack(c);
> grabbuttons(c, True);
> XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
> XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
> }
> else
> XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
> sel = c;
> drawbar();
> }
Thanks! This does the job, but if no window is urgent, you lose focus of
any window, and can't move around the focus stack anymore. I'm pretty
new to the dwm code, so this may be broken in some way, but I think you
can simplify to:
void
focusurgent(Arg *x) {
Client *c;
for(c = stack; c && !(c->isurgent); c = c->snext);
if(c) {
Arg a;
a.ui=c->tags;
view(&a);
focus(c);
}
}
Works for me.
Received on Fri Apr 24 2009 - 06:04:00 UTC
This archive was generated by hypermail 2.2.0 : Fri Apr 24 2009 - 06:12:05 UTC