aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <nilix@nilfm.cc>2021-03-10 00:22:55 -0500
committerDerek Stevens <nilix@nilfm.cc>2021-03-10 00:22:55 -0500
commit0e0de29de9018a7db94ba2538c06c3d1f1ad3eb3 (patch)
treee0726c264157f7e76e0f39a530b5ffdea9105c2d
parentc4a0ea2970e8887ea7f5c47427a84e4dd6d49089 (diff)
grab.c: don't grab server on sweeps -- fingers crossed!
-rw-r--r--grab.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/grab.c b/grab.c
index ad16a9d..860e6ec 100644
--- a/grab.c
+++ b/grab.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
+./* Copyright (c) 1994-1996 David Hogan, see README for licence details */
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xos.h>
@@ -555,6 +555,9 @@ void misleep(int msec) {
select(0, 0, 0, 0, &t);
}
+/* Not grabbing the server during sweep ops might make Xorg unstable.
+ -drkste */
+
int sweepdrag(
Client* c, int but, XButtonEvent* e0, BorderOrient bl,
int (*recalc)(Client*, int, int, BorderOrient, int)) {
@@ -578,7 +581,7 @@ int sweepdrag(
getmouse(&cx, &cy, c->screen);
else
getmouse(&c->x, &c->y, c->screen);
- XGrabServer(dpy);
+ //XGrabServer(dpy);
if (bl != BorderUnknown) {
notmoved = recalc(c, cx, cy, bl, notmoved);
}
@@ -588,12 +591,12 @@ int sweepdrag(
if (XCheckMaskEvent(dpy, ButtonMask, &ev) == 0) {
getmouse(&rx, &ry, c->screen);
if (rx != cx || ry != cy || ++idle > 300) {
- drawbound(c, 0);
+ drawbound(c, 1);
if (rx == cx && ry == cy) {
- XUngrabServer(dpy);
+ //XUngrabServer(dpy);
XFlush(dpy);
- misleep(500);
- XGrabServer(dpy);
+ //misleep(500);
+ //XGrabServer(dpy);
idle = 0;
}
if (e0 || bl != BorderUnknown)
@@ -614,7 +617,7 @@ int sweepdrag(
case ButtonRelease:
drawbound(c, 0);
ungrab(e);
- XUngrabServer(dpy);
+ //XUngrabServer(dpy);
if (e->button != but && c->init)
goto bad;
if (c->dx < 0) {