-/* xscreensaver, Copyright (c) 2001-2012 by Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2001-2013 by Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
gdk_pixbuf_xlib_init_with_depth (dpy, screen_number (screen), win_depth);
# ifdef HAVE_GTK2
+# if !GLIB_CHECK_VERSION(2, 36 ,0)
g_type_init();
+# endif
# else /* !HAVE_GTK2 */
xlib_rgb_init (dpy, screen);
# endif /* !HAVE_GTK2 */
draw_colorbars (screen, xgwa.visual, drawable, xgwa.colormap,
0, 0, 0, 0);
XSync (dpy, False);
+ if (! file_prop) file_prop = "";
+
}
break;
{
Atom a = XInternAtom (dpy, XA_XSCREENSAVER_IMAGE_FILENAME, False);
if (file_prop && *file_prop)
- 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);