/* dotfile.c --- management of the ~/.xscreensaver file.
- * xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1998-2013 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
#endif
+#include "version.h"
#include "prefs.h"
#include "resources.h"
"sgiSaverExtension",
"Boolean");
#endif
-#if 0 /* obsolete. */
+#ifdef HAVE_XINPUT
p->use_xinput_extension = get_boolean_resource (dpy, "xinputExtensionDev",
"Boolean");
#endif
if (p->dpms_standby == 0 && /* if *all* are 0, then DPMS is disabled */
p->dpms_suspend == 0 &&
- p->dpms_off == 0)
+ p->dpms_off == 0 &&
+ !(p->dpms_quickoff_p) /* ... but we want to do DPMS quick off */
+ )
p->dpms_enabled_p = False;
if (p->pointer_hysteresis < 0) p->pointer_hysteresis = 0;
if (p->pointer_hysteresis > 100) p->pointer_hysteresis = 100;
}
+
+
+/* Getting very tired of bug reports of already-fixed bugs due to
+ Linux distros shipping multi-year-old versions.
+ */
+Bool
+senescent_p (void)
+{
+ time_t now = time ((time_t *) 0);
+ struct tm *tm = localtime (&now);
+ const char *s = screensaver_id;
+ char mon[4], year[5];
+ int m, y, months;
+ s = strchr (s, ' '); if (!s) abort(); s++;
+ s = strchr (s, '('); if (!s) abort(); s++;
+ s = strchr (s, '-'); if (!s) abort(); s++;
+ strncpy (mon, s, 3);
+ mon[3] = 0;
+ s = strchr (s, '-'); if (!s) abort(); s++;
+ strncpy (year, s, 4);
+ year[4] = 0;
+ y = atoi (year);
+ if (!strcmp(mon, "Jan")) m = 0;
+ else if (!strcmp(mon, "Feb")) m = 1;
+ else if (!strcmp(mon, "Mar")) m = 2;
+ else if (!strcmp(mon, "Apr")) m = 3;
+ else if (!strcmp(mon, "May")) m = 4;
+ else if (!strcmp(mon, "Jun")) m = 5;
+ else if (!strcmp(mon, "Jul")) m = 6;
+ else if (!strcmp(mon, "Aug")) m = 7;
+ else if (!strcmp(mon, "Sep")) m = 8;
+ else if (!strcmp(mon, "Oct")) m = 9;
+ else if (!strcmp(mon, "Nov")) m = 10;
+ else if (!strcmp(mon, "Dec")) m = 11;
+ else abort();
+ months = ((((tm->tm_year + 1900) * 12) + tm->tm_mon) -
+ (y * 12 + m));
+
+ return (months > 12);
+}