- XChangeProperty (dpy, window, a, XA_STRING, 8, PropModeReplace,
- (unsigned char *) file_prop, strlen(file_prop));
+ {
+ char *f2 = strdup (file_prop);
+
+ /* Take the extension off of the file name. */
+ /* Duplicated in utils/grabclient.c. */
+ char *slash = strrchr (f2, '/');
+ char *dot = strrchr ((slash ? slash : f2), '.');
+ if (dot) *dot = 0;
+ /* Replace slashes with newlines */
+ /* while ((dot = strchr(f2, '/'))) *dot = '\n'; */
+ /* Replace slashes with spaces */
+ /* while ((dot = strchr(f2, '/'))) *dot = ' '; */
+
+ XChangeProperty (dpy, window, a, XA_STRING, 8, PropModeReplace,
+ (unsigned char *) f2, strlen(f2));
+ free (f2);
+ }
+ else
+ XDeleteProperty (dpy, window, a);
+
+ a = XInternAtom (dpy, XA_XSCREENSAVER_IMAGE_GEOMETRY, False);
+ if (geom.width > 0)
+ {
+ char gstr[30];
+ sprintf (gstr, "%dx%d+%d+%d", geom.width, geom.height, geom.x, geom.y);
+ XChangeProperty (dpy, window, a, XA_STRING, 8, PropModeReplace,
+ (unsigned char *) gstr, strlen (gstr));
+ }