-#ifdef HAVE_XSHM_EXTENSION
- if (st->use_shm)
- XShmPutImage (st->dpy, st->window, st->gc, st->buffer_map, x, y, x, y,
- w, h, False);
+ put_xshm_image (st->dpy, st->window, st->gc, st->buffer_map, x, y, x, y,
+ w, h, &st->shm_info);
+}
+
+
+static void
+set_mode(struct state *st)
+{
+ char *s = get_string_resource (st->dpy, "mode", "Mode");
+ if (!s || !*s || !strcasecmp (s, "random"))
+ {
+ switch (random() % 4) {
+ case 0: s = "stationary"; break;
+ case 1: s = "move"; break;
+ case 2: s = "sweep"; break;
+ case 3: s = "circle"; break;
+ default: abort();
+ }
+ }
+
+ st->move = False;
+ st->sweep = False;
+ st->circle = False;
+
+ if (!strcasecmp (s, "stationary"))
+ ;
+ else if (!strcasecmp (s, "move"))
+ st->move = True;
+ else if (!strcasecmp (s, "sweep"))
+ st->sweep = True;
+ else if (!strcasecmp (s, "circle"))
+ st->circle = True;