diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-01-14 16:31:16 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-01-14 16:31:16 +0200 |
| commit | 21a66e96c3fcffda3c8d44d6489bef80cae7484c (patch) | |
| tree | 2ce51de641729b9fd925f64427bb7e2e7948cb85 /monsterwm.c | |
| parent | 9fdf750750c7ee6f6e9e44cd359ce6a1aae53227 (diff) | |
fix CLICK_TO_FOCUS - revert to previous behavior but only grab button1 with no modifier
Diffstat (limited to 'monsterwm.c')
| -rw-r--r-- | monsterwm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/monsterwm.c b/monsterwm.c index f4b8091..ab73507 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -217,7 +217,6 @@ void addwindow(Window w) { prevfocus = current; XSelectInput(dis, ((current = c)->win = w), PropertyChangeMask|(FOLLOW_MOUSE?EnterWindowMask:0)); - if (CLICK_TO_FOCUS) XGrabButton(dis, Button1, None, w, True, ButtonPressMask, GrabModeAsync, GrabModeAsync, None, None); } /* on the press of a button check to see if there's a binded function to call */ @@ -940,11 +939,14 @@ void update_current(client *c) { for (client *c=head; c; c=c->next) { XSetWindowBorderWidth(dis, c->win, (c->isfullscreen ? 0 : border_width)); XSetWindowBorder(dis, c->win, (current == c ? win_focus : win_unfocus)); + if (CLICK_TO_FOCUS) XGrabButton(dis, Button1, None, c->win, True, + ButtonPressMask, GrabModeAsync, GrabModeAsync, None, None); } XChangeProperty(dis, root, netatoms[NET_ACTIVE], XA_WINDOW, 32, PropModeReplace, (unsigned char *)¤t->win, 1); XSetInputFocus(dis, current->win, RevertToPointerRoot, CurrentTime); XRaiseWindow(dis, current->win); + if (CLICK_TO_FOCUS) XUngrabButton(dis, Button1, None, current->win); XSync(dis, False); } |
