warp: dragmfact + dragcfact compatibility

These set of changes introduce:
   a) a flag to ignore warp from happening while dragmfact or
      dragcfact is being used and
   b) a flag to force warp when killclient or showhideclient
      is used, to make for a more intuitive experience

ref. https://github.com/bakkeby/patches/issues/11
This commit is contained in:
bakkeby
2020-10-06 08:45:17 +02:00
parent c47f61387d
commit 56c81ddbfa
5 changed files with 50 additions and 16 deletions

View File

@ -152,6 +152,11 @@ dragmfact(const Arg *arg)
if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
None, cursor[horizontal ? CurResizeVertArrow : CurResizeHorzArrow]->cursor, CurrentTime) != GrabSuccess)
return;
#if WARP_PATCH
ignore_warp = 1;
#endif // WARP_PATCH
XWarpPointer(dpy, None, root, 0, 0, 0, 0, px, py);
do {
@ -217,6 +222,10 @@ dragmfact(const Arg *arg)
}
} while (ev.type != ButtonRelease);
#if WARP_PATCH
ignore_warp = 0;
#endif // WARP_PATCH
XUngrabPointer(dpy, CurrentTime);
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}