+
+/* The first time we grab an image, do it the default way.
+ The second and subsequent times, add "-no-desktop" to the command.
+ That way we don't have to watch the window un-map 5+ times in a row.
+ Also, we end up with the desktop on only one channel, and pictures
+ on all the others (or colorbars, if no imageDirectory is set.)
+ */
+static void
+hack_resources (void)
+{
+ static int count = -1;
+ count++;
+
+ if (count == 0)
+ return;
+ else if (count == 1)
+ {
+ char *res = "desktopGrabber";
+ char *val = get_string_resource (res, "DesktopGrabber");
+ char buf1[255];
+ char buf2[255];
+ XrmValue value;
+ sprintf (buf1, "%.100s.%.100s", progclass, res);
+ sprintf (buf2, "%.200s -no-desktop", val);
+ value.addr = buf2;
+ value.size = strlen(buf2);
+ XrmPutResource (&db, buf1, "String", &value);
+ }
+}
+
+