(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);
(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);
}