diff --git a/src/client.c b/src/client.c index afb1c87..8cc0e83 100644 --- a/src/client.c +++ b/src/client.c @@ -141,6 +141,9 @@ uicb_client_next(uicb_t cmd) void client_focus(Client *c) { + Window w; + int d; + if(sel && sel != c) { sel->colors.frame = conf.client.bordernormal; @@ -163,8 +166,17 @@ client_focus(Client *c) c->titlebar->stipple_color = conf.titlebar.stipple.colors.focus; frame_update(c); mouse_grabbuttons(c, True); + if(conf.raisefocus) - client_raise(c); + { + XQueryPointer(dpy, ROOT, &w, &w, &d, &d, &d, &d, (uint *)&d); + + if(c == client_gb_win(w) + || c == client_gb_frame(w) + || c == client_gb_titlebar(w)) + client_raise(c); + } + XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); } else diff --git a/src/infobar.c b/src/infobar.c index 3bd6ad3..5925297 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -211,8 +211,7 @@ infobar_draw_statustext(int sc, char *str) if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\') { /* Store current color in col[] */ - for(j = 0, ++i; str[i + j] != '\\'; col[j] = str[i + j], ++j); - i += 8; + for(j = 0, ++i; str[i] != '\\'; col[j++] = str[i++]); buf += k; /* Draw a rectangle with the bar color to draw the text properly */ @@ -225,6 +224,7 @@ infobar_draw_statustext(int sc, char *str) FHINFOBAR, col, 0, buf); buf = _strdup(strwc); + ++i; } }