} d_options_t;
static gboolean quit = FALSE;
+static gboolean running = FALSE;
static void
read_options(int argc, char **argv, d_options_t *opts)
}
}
above = screen_find_window(sc, cev->above_sibling);
- screen_stacking_move_above(sc, w, above);
+ if (window_is_mapped(w))
+ sc->window_restack(w, above);
screen_refresh(w->sc);
break;
}
w = screen_find_window(sc, dev->drawable);
if (w) {
+ sc->window_damage(w);
screen_refresh(w->sc);
break;
}
d_window_t *w;
w = screen_find_window(sc, sev->affected_window);
- if (w) {
+ if (w && window_is_mapped(w)) {
sc->window_reshape(w);
screen_refresh(w->sc);
break;
{
struct timeval now, next_repaint;
+ running = TRUE;
+
gettimeofday(&now, NULL);
next_repaint = now;
int r, npaint, ntime;
d_list_it_t *it;
fd_set fds;
+ gboolean due;
event(dpy);
}
}
- if (!npaint && !ntime)
+ if (!npaint && !ntime) {
/* wait forever, there is nothing that needs drawing */
wait = NULL;
+ due = FALSE;
+ }
else if (time_compare(&next, &now) > 0) {
/* wait until the next allowed redraw time */
time_difference(&next, &now, &next);
wait = &next;
+ due = FALSE;
}
else {
/* don't wait cuz a timer is due now already */
- next.tv_sec = 0;
- next.tv_usec = 1;
- wait = &next;
+ due = TRUE;
}
- FD_ZERO(&fds);
- FD_SET(dpy->fd, &fds);
-
- //printf("select %d\n", npaint);
+ //printf("select? %d %d\n", due, npaint);
- r = select(dpy->fd+1, &fds, NULL, NULL, wait);
+ if (!due) {
+ FD_ZERO(&fds);
+ FD_SET(dpy->fd, &fds);
+ r = select(dpy->fd+1, &fds, NULL, NULL, wait);
+ }
+ else
+ r = 0;
gettimeofday(&now, NULL);
if (r == 0) {
if (xcb_connection_has_error(dpy->conn))
quit = TRUE;
}
+
+ running = FALSE;
}
static void
}
}
+ printf("running\n");
run(dpy);
{
display_unref(dpy);
return 0;
}
+
+gboolean
+dcompmgr_running(void)
+{
+ return running;
+}