summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2024-04-10 19:38:23 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2024-04-10 19:38:23 +0000
commit982d98055c6d717845e8f982dd4c3192c2bdd3e1 (patch)
tree2a8322780e6be741e3eb3deb9aa703eb5707a105 /app/cwm
parent49f38ffb43fa845b05605244cfd638dbe0585253 (diff)
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!
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/kbfunc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index cbfa799c5..7fecfb731 100644
--- a/app/cwm/kbfunc.c
+++ b/app/cwm/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: kbfunc.c,v 1.174 2023/07/20 14:39:34 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.175 2024/04/10 19:38:22 okan Exp $
*/
#include <sys/types.h>
@@ -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,