]> git.mdlowis.com Git - projs/tide.git/commitdiff
roll back change that made UI updates flaky
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 18 Dec 2018 02:30:32 +0000 (21:30 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 18 Dec 2018 02:30:32 +0000 (21:30 -0500)
src/lib/x11.c

index c646320baf82b41459a83e16322bf3fb623f647d..1a7fe71b86428341d008067e3d88e5fcd9d33069 100644 (file)
@@ -430,7 +430,7 @@ static void xupdate(Job* job) {
     (void)job;
     int nevents;
     /* process events from the queue */
-    int dirty = XEventsQueued(X.display, QueuedAfterFlush);
+    XEventsQueued(X.display, QueuedAfterFlush);
     XGetMotionEvents(X.display, X.self, CurrentTime, CurrentTime, &nevents);
     for (XEvent e; XPending(X.display);) {
         XNextEvent(X.display, &e);
@@ -438,23 +438,20 @@ static void xupdate(Job* job) {
             (X.eventfns[e.type])(&X, &e);
         for (int status; waitpid(-1, &status, WNOHANG) > 0;);
     }
-    /* only redraw if we processed some events */
-    if (dirty || nevents) {
-        /* determine the size of the regions */
-        size_t maxtagrows = ((X.height/4) / X.tagfont->height);
-        size_t tagrows = view_limitrows(win_view(TAGS), maxtagrows);
-        size_t tagregsz = (tagrows * X.tagfont->height) + 7;
-        size_t editrows = (X.height - tagregsz) / X.font->height ;
-        /* draw the regions to the window */
-        drawcsr csr = { .w = X.width, .h = X.height };
-        csr.x += ScrollWidth + 1;
-        draw_statbox();
-        draw_view(&Regions[TAGS], X.tagfont, tagrows, &csr, TagsBg, TagsFg, TagsSel);
-        draw_hrule(&csr);
-        draw_view(&Regions[EDIT], X.font, editrows, &csr, EditBg, EditFg, EditSel);
-        draw_scroll(&csr);
-        XCopyArea(X.display, X.pixmap, X.self, X.gc, 0, 0, X.width, X.height, 0, 0);
-    }
+    /* determine the size of the regions */
+    size_t maxtagrows = ((X.height/4) / X.tagfont->height);
+    size_t tagrows = view_limitrows(win_view(TAGS), maxtagrows);
+    size_t tagregsz = (tagrows * X.tagfont->height) + 7;
+    size_t editrows = (X.height - tagregsz) / X.font->height ;
+    /* draw the regions to the window */
+    drawcsr csr = { .w = X.width, .h = X.height };
+    csr.x += ScrollWidth + 1;
+    draw_statbox();
+    draw_view(&Regions[TAGS], X.tagfont, tagrows, &csr, TagsBg, TagsFg, TagsSel);
+    draw_hrule(&csr);
+    draw_view(&Regions[EDIT], X.font, editrows, &csr, EditBg, EditFg, EditSel);
+    draw_scroll(&csr);
+    XCopyArea(X.display, X.pixmap, X.self, X.gc, 0, 0, X.width, X.height, 0, 0);
     XFlush(X.display);
 }