adding XPending checks before pointer grabs

This commit is contained in:
Anselm R. Garbe 2006-05-10 14:05:48 +02:00
parent 7509382a8c
commit b59dee84cf
1 changed files with 8 additions and 6 deletions

View File

@ -195,9 +195,10 @@ do_mouse_move(Client *c, XButtonPressedEvent *e, Bool swap)
pt.y = ey;
XSync(dpy, False);
if(XGrabPointer(dpy, root, False, PointerMotionMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, cursor[CurMove],
e->time) != GrabSuccess)
if(XPending(dpy) ||
(XGrabPointer(dpy, root, False, PointerMotionMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, cursor[CurMove], e->time)
!= GrabSuccess))
return;
XGrabServer(dpy);
@ -438,9 +439,10 @@ do_mouse_resize(Client *c, XButtonPressedEvent *e, BlitzAlign align)
XQueryPointer(dpy, c->framewin, &dummy, &dummy, &i, &i, &ox, &oy, &dmask);
XSync(dpy, False);
if(XGrabPointer(dpy, c->framewin, False, PointerMotionMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, cursor[CurResize],
e->time) != GrabSuccess)
if(XPending(dpy) ||
(XGrabPointer(dpy, c->framewin, False, PointerMotionMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, cursor[CurResize], e->time)
!= GrabSuccess))
return;
XGrabServer(dpy);