/* dotfile.c --- management of the ~/.xscreensaver file.
- * xscreensaver, Copyright (c) 1998-2008 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"
"ignoreUninstalledPrograms",
"font",
"dpmsEnabled",
+ "dpmsQuickOff",
"dpmsStandby",
"dpmsSuspend",
"dpmsOff",
"pointerHysteresis",
"windowCreationTimeout",
"initialDelay",
- "sgiSaverExtension",
+ "sgiSaverExtension", /* not saved -- obsolete */
"mitSaverExtension", /* not saved -- obsolete */
- "xidleExtension",
+ "xidleExtension", /* not saved -- obsolete */
"GetViewPortIsFullOfLies",
"procInterrupts",
+ "xinputExtensionDev",
"overlayStderr",
"overlayTextBackground", /* not saved -- X resources only */
"overlayTextForeground", /* not saved -- X resources only */
CHECK("font") type = pref_str, s = stderr_font;
CHECK("dpmsEnabled") type = pref_bool, b = p->dpms_enabled_p;
+ CHECK("dpmsQuickOff") type = pref_bool, b = p->dpms_quickoff_p;
CHECK("dpmsStandby") type = pref_time, t = p->dpms_standby;
CHECK("dpmsSuspend") type = pref_time, t = p->dpms_suspend;
CHECK("dpmsOff") type = pref_time, t = p->dpms_off;
CHECK("pointerHysteresis")type = pref_int, i = p->pointer_hysteresis;
CHECK("windowCreationTimeout")type=pref_time,t= p->notice_events_timeout;
CHECK("initialDelay") type = pref_time, t = p->initial_delay;
- CHECK("sgiSaverExtension")type = pref_bool, b=p->use_sgi_saver_extension;
+ CHECK("sgiSaverExtension") continue; /* don't save */
CHECK("mitSaverExtension") continue; /* don't save */
- CHECK("xidleExtension") type = pref_bool, b = p->use_xidle_extension;
+ CHECK("xidleExtension") continue; /* don't save */
CHECK("procInterrupts") type = pref_bool, b = p->use_proc_interrupts;
+ CHECK("xinputExtensionDev") type = pref_bool, b = p->use_xinput_extension;
CHECK("GetViewPortIsFullOfLies") type = pref_bool,
b = p->getviewport_full_of_lies_p;
CHECK("overlayStderr") type = pref_bool, b = overlay_stderr_p;
CHECK("overlayTextBackground") continue; /* don't save */
CHECK("overlayTextForeground") continue; /* don't save */
- CHECK("bourneShell") continue;
+ CHECK("bourneShell") continue; /* don't save */
else abort();
# undef CHECK
"Time");
p->dpms_enabled_p = get_boolean_resource (dpy, "dpmsEnabled", "Boolean");
+ p->dpms_quickoff_p = get_boolean_resource (dpy, "dpmsQuickOff", "Boolean");
p->dpms_standby = 1000 * get_minutes_resource (dpy, "dpmsStandby", "Time");
p->dpms_suspend = 1000 * get_minutes_resource (dpy, "dpmsSuspend", "Time");
p->dpms_off = 1000 * get_minutes_resource (dpy, "dpmsOff", "Time");
}
p->use_xidle_extension = get_boolean_resource (dpy, "xidleExtension","Boolean");
-#if 0 /* ignore this, it is evil. */
+#if 0 /* obsolete. */
+ p->use_sgi_saver_extension = get_boolean_resource (dpy,
+ "sgiSaverExtension",
+ "Boolean");
+#endif
+#ifdef HAVE_XINPUT
+ p->use_xinput_extension = get_boolean_resource (dpy, "xinputExtensionDev",
+ "Boolean");
+#endif
+#if 0 /* broken and evil. */
p->use_mit_saver_extension = get_boolean_resource (dpy,
"mitSaverExtension",
"Boolean");
#endif
- p->use_sgi_saver_extension = get_boolean_resource (dpy,
- "sgiSaverExtension",
- "Boolean");
+
p->use_proc_interrupts = get_boolean_resource (dpy,
"procInterrupts", "Boolean");
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);
+}