[PATCH 2/2] wmaker: ignore queued motion before the screenshot anchor click

1 view
Skip to first unread message

david.m...@gmail.com

unread,
Jun 13, 2026, 9:39:06 AMJun 13
to Window Maker Development
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) {
--
2.43.0
0002-wmaker-ignore-queued-motion-before-the-screenshot-an.patch
Reply all
Reply to author
Forward
0 new messages