diff --git a/cmd/wm/event.c b/cmd/wm/event.c index d3bbbdd4..ec7a20a5 100644 --- a/cmd/wm/event.c +++ b/cmd/wm/event.c @@ -103,9 +103,10 @@ handle_buttonpress(XEvent *e) if((f = frame_of_win(ev->window))) { ev->state &= valid_mask; - if(blitz_bpress_input(&f->tagbar, ev->x, ev->y)) + if(blitz_bpress_input(&f->tagbar, ev->x, ev->y)) { draw_frame(f); - if((ev->state & def.mod) == def.mod) { + } + else if((ev->state & def.mod) == def.mod) { focus(f->client, True); switch(ev->button) { case Button1: diff --git a/liblitz/input.c b/liblitz/input.c index 0fcf795b..203e5d60 100644 --- a/liblitz/input.c +++ b/liblitz/input.c @@ -174,6 +174,8 @@ blitz_bpress_input(BlitzInput *i, int x, int y) if(!(i->drag = blitz_ispointinrect(x, y, &i->rect))) return False; + XSetInputFocus(i->blitz->dpy, i->win, + RevertToPointerRoot, CurrentTime); ostart = i->curstart; oend = i->curend; i->curstart = i->curend = charof(i, x, y); @@ -187,6 +189,8 @@ blitz_brelease_input(BlitzInput *i, int x, int y) if(!(i->drag = blitz_ispointinrect(x, y, &i->rect))) return False; + XSetInputFocus(i->blitz->dpy, i->win, + RevertToPointerRoot, CurrentTime); oend = i->curend; i->curend = charof(i, x, y); i->drag = False;