diff -r ff43e9bf3cea gui-x11/x11.c --- a/gui-x11/x11.c Wed Oct 03 19:29:18 2018 +0200 +++ b/gui-x11/x11.c Tue Feb 19 21:05:26 2019 +0100 @@ -26,6 +26,7 @@ #include #include #include +#include #include "keysym2ucs.h" #undef Font @@ -132,6 +133,7 @@ static int xscreendepth; static XDisplay* xkmcon; /* used only in xproc */ static XDisplay* xsnarfcon; /* used holding clip.lk */ +static Point orgpt; static int putsnarf, assertsnarf; @@ -212,7 +214,7 @@ mouseset(Point xy) { qlock(&drawlock); - XWarpPointer(xdisplay, None, xdrawable, 0, 0, 0, 0, xy.x, xy.y); + XTestFakeMotionEvent(xdisplay, -1, orgpt.x+xy.x, orgpt.y+xy.y, CurrentTime); XFlush(xdisplay); qunlock(&drawlock); } @@ -654,9 +656,14 @@ static void xresize(XEvent *e) { + XConfigureEvent *xe; + if(e->type != ConfigureNotify) return; - screenresize(Rect(0, 0, ((XConfigureEvent*)e)->width, ((XConfigureEvent*)e)->height)); + xe = (XConfigureEvent*)e; + screenresize(Rect(0, 0, xe->width, xe->height)); + orgpt.x = xe->x; + orgpt.y = xe->y; } static void