From: Michael D. Lowis Date: Mon, 1 May 2017 19:31:44 +0000 (-0400) Subject: really crappy optimization for pointer tracking. probably not the right way to do... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=fdcce164a573fcff001f4a95fed85fb876dc787e;p=projs%2Ftide.git really crappy optimization for pointer tracking. probably not the right way to do it but performance seems better... --- diff --git a/lib/x11.c b/lib/x11.c index 7fe2dbe..b18d8da 100644 --- a/lib/x11.c +++ b/lib/x11.c @@ -136,6 +136,7 @@ void x11_window(char* name, int width, int height) { | ButtonReleaseMask | ButtonMotionMask | PointerMotionMask + | PointerMotionHintMask | KeyPressMask ); @@ -330,6 +331,9 @@ void x11_loop(void) { /* wait for events with a timeout, then handle them if we got any */ int ready = select(xfd+1, &fds, NULL, NULL, &tv); if (ready > 0) { + Window xw; int x, winx, winy; unsigned int ux; + XQueryPointer(X.display, X.window, &xw, &xw, &x, &x, &winx, &winy, &ux); + Config->handle_mouse(MOUSE_ACT_MOVE, MOUSE_BTN_LEFT, winx, winy); x11_handle_events(); Config->redraw(X.width, X.height); XCopyArea(X.display, X.pixmap, X.window, X.gc, 0, 0, X.width, X.height, 0, 0);