From 90ce10998cd1d9bf8970796d2dae7ca0200ef03e Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sat, 13 Jun 2026 09:29:04 -0400 Subject: [PATCH] wmaker: ignore queued motion before the screenshot anchor click imageCaptureArea() consumed any MotionNotify still queued from the root window before Button1 set the anchor point, with xp,yp still -1 the rectangle math anchored the XOR wireframe at (-1,-1) and drew a box from the top-left corner to the pointer. Drop motion events until the press has recorded an anchor. --- src/screen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/screen.c b/src/screen.c index b8f83af9..ba007cca 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1170,6 +1170,10 @@ static XImage *imageCaptureArea(WScreen *scr) } break; case MotionNotify: + /* drop stale root MotionNotify still queued from before + * the grab, otherwise the rectangle anchors at (-1,-1) */ + if (xp < 0) + break; XDrawRectangle(dpy, scr->root_win, scr->frame_gc, x, y, w, h); x = event.xmotion.x_root; if (x < xp) {