Grab the pointer against the root window instead of the client we're attempting

to move and/or resize; prevents XNextEvent() from blocking on a client that
might have been moved to a Withdrawn state.

behavior noticed and reported by zenitds at proton.me - thanks!
This commit is contained in:
okan
2024-04-10 19:38:22 +00:00
parent d86d3aa419
commit 2a2d268cb0

View File

@@ -162,7 +162,7 @@ kbfunc_client_move_mb(void *ctx, struct cargs *cargs)
client_ptr_inbound(cc, 1);
if (XGrabPointer(X_Dpy, cc->win, False, MOUSEMASK,
if (XGrabPointer(X_Dpy, sc->rootwin, False, MOUSEMASK,
GrabModeAsync, GrabModeAsync, None, Conf.cursor[CF_MOVE],
CurrentTime) != GrabSuccess)
return;
@@ -251,7 +251,7 @@ kbfunc_client_resize_mb(void *ctx, struct cargs *cargs)
xu_ptr_set(cc->win, cc->geom.w, cc->geom.h);
if (XGrabPointer(X_Dpy, cc->win, False, MOUSEMASK,
if (XGrabPointer(X_Dpy, sc->rootwin, False, MOUSEMASK,
GrabModeAsync, GrabModeAsync, None, Conf.cursor[CF_RESIZE],
CurrentTime) != GrabSuccess)
return;
@@ -267,8 +267,8 @@ kbfunc_client_resize_mb(void *ctx, struct cargs *cargs)
continue;
ltime = ev.xmotion.time;
cc->geom.w = ev.xmotion.x;
cc->geom.h = ev.xmotion.y;
cc->geom.w = ev.xmotion.x - cc->geom.x - cc->bwidth;
cc->geom.h = ev.xmotion.y - cc->geom.y - cc->bwidth;
client_apply_sizehints(cc);
client_resize(cc, 1);
screen_prop_win_draw(sc,