From fdcce164a573fcff001f4a95fed85fb876dc787e Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 1 May 2017 15:31:44 -0400 Subject: [PATCH] really crappy optimization for pointer tracking. probably not the right way to do it but performance seems better... --- lib/x11.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.51.0