- XGetWindowAttributes (dpy, window, &xgwa);
- grab_screen_image (xgwa.screen, window);
+ st->dpy = dpy;
+ st->window = window;
+ XGetWindowAttributes (st->dpy, st->window, &xgwa);
+ st->img_loader = load_image_async_simple (0, xgwa.screen, st->window,
+ st->window, 0, 0);
+ st->start_time = time ((time_t) 0);
+
+ st->max_width = xgwa.width;
+ st->max_height = xgwa.height;
+
+ st->delay = get_integer_resource (st->dpy, "delay", "Integer");
+ st->delay2 = get_integer_resource (st->dpy, "delay2", "Integer");
+ st->duration = get_integer_resource (st->dpy, "duration", "Seconds");
+ st->grid_size = get_integer_resource (st->dpy, "gridSize", "Integer");
+ st->pix_inc = get_integer_resource (st->dpy, "pixelIncrement", "Integer");
+
+ /* Don't let the grid be smaller than 5x5 */
+ while (st->grid_size > xgwa.width / 5)
+ st->grid_size /= 2;
+ while (st->grid_size > xgwa.height / 5)
+ st->grid_size /= 2;