mirror of
https://github.com/gryf/wmaker.git
synced 2026-06-18 08:25:23 +02:00
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.
This commit is contained in:
committed by
Carlos R. Mafra
parent
f18de447f6
commit
90ce10998c
@@ -1170,6 +1170,10 @@ static XImage *imageCaptureArea(WScreen *scr)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
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);
|
XDrawRectangle(dpy, scr->root_win, scr->frame_gc, x, y, w, h);
|
||||||
x = event.xmotion.x_root;
|
x = event.xmotion.x_root;
|
||||||
if (x < xp) {
|
if (x < xp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user