X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=event.c;h=938655dae57d47b598d9be5c9d2aea92f9543f2b;hb=dc9f62f39370455b217595a0fbd34b405585c45f;hp=e0718d3fb2ffe7b46223cbc24d33eae3dbfd4178;hpb=b233089815367983e07939b2aabb999fdc359f91;p=dwm.git diff --git a/event.c b/event.c index e0718d3..938655d 100644 --- a/event.c +++ b/event.c @@ -82,7 +82,10 @@ resizemouse(Client *c) { switch(ev.type) { case ButtonRelease: resize(c, True); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, + c->w + c->border - 1, c->h + c->border - 1); XUngrabPointer(dpy, CurrentTime); + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); return; case ConfigureRequest: case Expose: @@ -230,7 +233,7 @@ enternotify(XEvent *e) { if((c = getclient(ev->window)) && isvisible(c)) focus(c); else if(ev->window == root) { - issel = True; + selscreen = True; for(c = stack; c && !isvisible(c); c = c->snext); focus(c); } @@ -269,8 +272,8 @@ leavenotify(XEvent *e) { XCrossingEvent *ev = &e->xcrossing; if((ev->window == root) && !ev->same_screen) { + selscreen = False; focus(NULL); - issel = False; } } @@ -308,10 +311,6 @@ propertynotify(XEvent *e) { if(ev->state == PropertyDelete) return; /* ignore */ if((c = getclient(ev->window))) { - if(ev->atom == wmatom[WMProtocols]) { - c->proto = getproto(c->win); - return; - } switch (ev->atom) { default: break; case XA_WM_TRANSIENT_FOR: