From ed683c9966edc3522aec958bdb40e8ff8a20287f Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 13 Jun 2025 21:58:11 -0700 Subject: clickety: handle edge case where impetus is centered This actually became likely to happen with the introduction of the 'm' modifier for moving the pointer to the focused window's center. Occasionally I'll accidentally initiate a resize after a Mod1-m to brin the mouse pointer, because I'm accessing the xterm popup window for tweaking something like font size. But instead of pressing ctrl-rclick, I hit mod1-rclick, and if perfectly centered, this would disappear the window on release. Ultimately it's an off by one error of sorts, just give the boundary case to the < side. --- src/clickety.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/clickety.c') diff --git a/src/clickety.c b/src/clickety.c index b5ea417..b7495c8 100644 --- a/src/clickety.c +++ b/src/clickety.c @@ -74,19 +74,19 @@ static void compute_resize(XEvent *terminus, XWindowAttributes *new) xdelta = xdelta / width_inc * width_inc; ydelta = ydelta / height_inc * height_inc; - if (clickety.impetus_x < dw && clickety.impetus_y < dh) { + if (clickety.impetus_x <= dw && clickety.impetus_y <= dh) { /* grabbed top left */ new->x = clickety.orig.x + xdelta; new->y = clickety.orig.y + ydelta; new->width = clickety.orig.width - xdelta; new->height = clickety.orig.height - ydelta; - } else if (clickety.impetus_x > dw && clickety.impetus_y < dh) { + } else if (clickety.impetus_x > dw && clickety.impetus_y <= dh) { /* grabbed top right */ new->x = clickety.orig.x; new->y = clickety.orig.y + ydelta; new->width = clickety.orig.width + xdelta; new->height = clickety.orig.height - ydelta; - } else if (clickety.impetus_x < dw && clickety.impetus_y > dh) { + } else if (clickety.impetus_x <= dw && clickety.impetus_y > dh) { /* grabbed bottom left */ new->x = clickety.orig.x + xdelta; new->y = clickety.orig.y; -- cgit v1.2.3