X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fprefs.c;h=8fb029eed4bdfa954546ec49158adde45d78720a;hb=78add6e627ee5f10e1fa6f3852602ea5066eee5a;hp=f01f11476c6f17c43a7a636d898d700b0693f6f9;hpb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;p=xscreensaver diff --git a/driver/prefs.c b/driver/prefs.c index f01f1147..8fb029ee 100644 --- a/driver/prefs.c +++ b/driver/prefs.c @@ -1,5 +1,5 @@ /* dotfile.c --- management of the ~/.xscreensaver file. - * xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski + * xscreensaver, Copyright (c) 1998-2018 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -64,6 +64,7 @@ #endif +#include "version.h" #include "prefs.h" #include "resources.h" @@ -308,6 +309,7 @@ static const char * const prefs[] = { "overlayTextBackground", /* not saved -- X resources only */ "overlayTextForeground", /* not saved -- X resources only */ "bourneShell", /* not saved -- X resources only */ + "authWarningSlack", 0 }; @@ -753,7 +755,7 @@ write_init_file (Display *dpy, fprintf (out, "# %s Preferences File\n" "# Written by %s %s for %s on %s.\n" - "# http://www.jwz.org/xscreensaver/\n" + "# https://www.jwz.org/xscreensaver/\n" "\n", progclass, progname, version_string, whoami, timestr); } @@ -864,6 +866,7 @@ write_init_file (Display *dpy, CHECK("overlayTextBackground") continue; /* don't save */ CHECK("overlayTextForeground") continue; /* don't save */ CHECK("bourneShell") continue; /* don't save */ + CHECK("authWarningSlack") type = pref_int, i = p->auth_warning_slack; else abort(); # undef CHECK @@ -1101,6 +1104,8 @@ load_init_file (Display *dpy, saver_preferences *p) p->new_login_command = get_string_resource(dpy, "newLoginCommand", "NewLoginCommand"); + p->auth_warning_slack = get_integer_resource(dpy, "authWarningSlack", + "Integer"); /* If "*splash" is unset, default to true. */ { @@ -1634,7 +1639,9 @@ stop_the_insanity (saver_preferences *p) 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; @@ -1647,4 +1654,117 @@ stop_the_insanity (saver_preferences *p) if (p->pointer_hysteresis < 0) p->pointer_hysteresis = 0; if (p->pointer_hysteresis > 100) p->pointer_hysteresis = 100; + + if (p->auth_warning_slack < 0) p->auth_warning_slack = 0; + if (p->auth_warning_slack > 300) p->auth_warning_slack = 300; +} + + +Bool +senesculent_p (void) +{ + /* If you are in here because you're planning on disabling this warning + before redistributing my software, please don't. + + I sincerely request that you do one of the following: + + 1: leave this code intact and this warning in place, -OR- + + 2: Remove xscreensaver from your distribution. + + I would seriously prefer that you not distribute my software at all + than that you distribute one version and then never update it for + years. + + I am *constantly* getting email from users reporting bugs that have + been fixed for literally years who have no idea that the software + they are running is years out of date. Yes, it would be great if we + lived in the ideal world where people checked that they were running + the latest release before they report a bug, but we don't. To most + people, "running the latest release" is synonymous with "running the + latest release that my distro packages for me." + + When they even bother to tell me what version they're running, I + say, "That version is three years old!", and they say "But this is + the latest version my distro ships". Then I say, "your distro + sucks", and they say "but I don't know how to compile from source, + herp derp I eat paste", and *everybody* goes away unhappy. + + It wastes an enormous amount of my time, but worse than that, it + does a grave disservice to the users, who are stuck experiencing + bugs that are already fixed! These users think they are running the + latest release, and they are not. They would like to be running the + actual latest release, but they don't know how, because their distro + makes that very difficult for them. It's terrible for everyone, and + kind of makes me regret ever having released this software in the + first place. + + So seriously. I ask that if you're planning on disabling this + obsolescence warning, that you instead just remove xscreensaver from + your distro entirely. Everybody will be happier that way. Check + out gnome-screensaver instead, I understand it's really nice. + + Of course, my license allows you to ignore me and do whatever the + fuck you want, but as the author, I hope you will have the common + courtesy of complying with my request. + + Thank you! + + jwz, 2014, 2016, 2018. + + PS: In particular, since Debian refuses to upgrade software on any + kind of rational timeline, I have asked that they stop shipping + xscreensaver at all. They have refused. Instead of upgrading the + software, they simply patched out this warning. + + If you want to witness the sad state of the open source peanut + gallery, look no farther than the comments on my blog: + http://jwz.org/b/yiYo + + Many of these people fall back on their go-to argument of, "If it is + legal, it must be right." If you believe in that rhetorical device + then you are a terrible person, and possibly a sociopath. + + There are also the armchair lawyers who say "Well, instead of + *asking* people to do the right thing out of common courtesy, you + should just change your license to prohibit them from acting + amorally." Again, this is the answer of a sociopath, but that aside, + if you devote even a second's thought to this you will realize that + the end result of this would be for distros like Debian to just keep + shipping the last version with the old license and then never + upgrading it again -- which would be the worst possible outcome for + everyone involved, most especially the users. + */ + + time_t now = time ((time_t *) 0); /* d */ + struct tm *tm = localtime (&now); /* o */ + const char *s = screensaver_id; /* n */ + char mon[4], year[5]; /* ' */ + int m, y, mrnths; /* t */ + s = strchr (s, ' '); if (!s) abort(); s++; /* */ + s = strchr (s, '('); if (!s) abort(); s++; /* d */ + s = strchr (s, '-'); if (!s) abort(); s++; /* o */ + strncpy (mon, s, 3); /* o */ + mon[3] = 0; /* */ + s = strchr (s, '-'); if (!s) abort(); s++; /* e */ + strncpy (year, s, 4); /* e */ + year[4] = 0; /* t */ + y = atoi (year); /* , */ + if (!strcmp(mon, "Jan")) m = 0; /* */ + else if (!strcmp(mon, "Feb")) m = 1; /* s */ + else if (!strcmp(mon, "Mar")) m = 2; /* t */ + else if (!strcmp(mon, "Apr")) m = 3; /* o */ + else if (!strcmp(mon, "May")) m = 4; /* p */ + else if (!strcmp(mon, "Jun")) m = 5; /* , */ + else if (!strcmp(mon, "Jul")) m = 6; /* */ + else if (!strcmp(mon, "Aug")) m = 7; /* s */ + else if (!strcmp(mon, "Sep")) m = 8; /* t */ + else if (!strcmp(mon, "Oct")) m = 9; /* a */ + else if (!strcmp(mon, "Nov")) m = 10; /* a */ + else if (!strcmp(mon, "Dec")) m = 11; /* a */ + else abort(); /* h */ + mrnths = ((((tm->tm_year + 1900) * 12) + tm->tm_mon) - /* h */ + (y * 12 + m)); /* h */ + /* p */ + return (mrnths >= 17); /* . */ }