Client: Fix endless focus bug with raisefocus option.
This commit is contained in:
parent
d49a2b4dfc
commit
d8f3db227a
14
src/client.c
14
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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user