]> git.mdlowis.com Git - projs/tide.git/commitdiff
really crappy optimization for pointer tracking. probably not the right way to do...
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 1 May 2017 19:31:44 +0000 (15:31 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 1 May 2017 19:31:44 +0000 (15:31 -0400)
lib/x11.c

index 7fe2dbee6c5697df376885958e7cfb3420583f53..b18d8da655c3480889be82b0267b9bac59846128 100644 (file)
--- 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);