diff --git a/gui-x11/x11.c b/gui-x11/x11.c --- a/gui-x11/x11.c +++ b/gui-x11/x11.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "keysym2ucs.h" #undef Font @@ -47,6 +48,8 @@ static Drawable xscreenid; static XImage* xscreenimage; static Visual *xvis; +static Point orgpt; +static Window rootwin; #include "../glenda-t.xbm" @@ -212,7 +215,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); } @@ -326,7 +329,6 @@ Memimage *gscreen; int i, xsize, ysize; char *argv[2]; - Window rootwin; Rectangle r; XWMHints hints; XScreen *screen; @@ -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