From 2954208d00d422b34fa3a69631b0a091f17a349d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 2 Dec 2020 08:23:52 +0100 Subject: 5.44 --- driver/Makefile.in | 23 +++++++++++----- driver/XScreenSaver.ad.in | 12 ++++++--- driver/demo-Gtk.c | 23 +++++++++++----- driver/lock.c | 15 +++++++++++ driver/passwd.c | 19 +++++++------- driver/prefs.c | 55 +++++++++++++++++++++------------------ driver/subprocs.c | 6 ++--- driver/timers.c | 8 +++++- driver/types.h | 3 ++- driver/windows.c | 11 +++++--- driver/xscreensaver-getimage-file | 5 ++-- driver/xscreensaver-text | 21 ++++++++++++--- driver/xscreensaver.c | 12 +++++++-- 13 files changed, 148 insertions(+), 65 deletions(-) (limited to 'driver') diff --git a/driver/Makefile.in b/driver/Makefile.in index 4ca00b6..7baf504 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -301,7 +301,7 @@ install-program: $(EXES) echo $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver ; \ $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver @for exe in xscreensaver-command xscreensaver-demo \ - xscreensaver-getimage @EXES_OSX@ ; do \ + xscreensaver-getimage @EXES_OSX@ @EXES_SYSTEMD@ ; do \ echo $(INSTALL_PROGRAM) $$exe $(install_prefix)$(bindir)/$$exe ; \ $(INSTALL_PROGRAM) $$exe $(install_prefix)$(bindir)/$$exe ; \ done @@ -633,7 +633,9 @@ clean: distclean: clean -rm -f Makefile XScreenSaver.ad \ - TAGS *~ "#"* screensaver-properties.desktop + TAGS *~ "#"* screensaver-properties.desktop \ + xscreensaver-demo.glade2 \ + xscreensaver.pam # Adds all current dependencies to Makefile depend: XScreenSaver_ad.h XScreenSaver_Xm_ad.h @@ -651,9 +653,10 @@ distdepend: check_men update_ad_version XScreenSaver_ad.h XScreenSaver_Xm_ad.h $(DEPEND) -w 0 -f - \ -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \ $(INCLUDES_1) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \ - $(SAVER_SRCS_1) $(MOTIF_SRCS) $(GTK_SRCS) $(GETIMG_SRCS_1) \ - $(PWENT_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) \ - $(SYSTEMD_SRCS) $(TEST_SRCS) 2>/dev/null | \ + $(SAVER_SRCS_1) $(SYSTEMD_SRCS) $(MOTIF_SRCS) $(GTK_SRCS) \ + $(PWENT_SRCS) $(PWHELPER_SRCS) $(KERBEROS_SRCS) $(PAM_SRCS) \ + $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(GETIMG_SRCS_1) \ + $(PDF2JPEG_SRCS) $(TEST_SRCS) 2>/dev/null | \ sort -d | \ ( \ awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \ @@ -866,7 +869,7 @@ test-mlstring.o: mlstring.c test-mlstring: test-mlstring.o $(CC) -DTEST $(LDFLAGS) -o $@ test-mlstring.o $(SAVER_LIBS) -TEST_FADE_OBJS = test-fade.o $(UTILS_SRC)/fade.o $(DEMO_UTIL_OBJS) +TEST_FADE_OBJS = test-fade.o $(UTILS_BIN)/fade.o $(DEMO_UTIL_OBJS) test-fade: test-fade.o $(UTILS_BIN)/fade.o $(CC) $(LDFLAGS) -o $@ $(TEST_FADE_OBJS) $(SAVER_LIBS) @@ -923,11 +926,19 @@ lock.o: $(srcdir)/types.h lock.o: $(UTILS_SRC)/resources.h lock.o: $(srcdir)/xscreensaver.h mlstring.o: $(srcdir)/mlstring.h +passwd-helper.o: ../config.h +passwd-helper.o: $(srcdir)/prefs.h +passwd-helper.o: $(srcdir)/types.h +passwd-helper.o: $(srcdir)/xscreensaver.h +passwd-kerberos.o: ../config.h passwd.o: $(srcdir)/auth.h passwd.o: ../config.h passwd.o: $(srcdir)/prefs.h passwd.o: $(srcdir)/types.h passwd.o: $(srcdir)/xscreensaver.h +passwd-pam.o: $(srcdir)/auth.h +passwd-pam.o: ../config.h +passwd-pam.o: $(srcdir)/types.h passwd-pwent.o: ../config.h prefs.o: ../config.h prefs.o: $(srcdir)/prefs.h diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index 5deb334..cfdd1a2 100644 --- a/driver/XScreenSaver.ad.in +++ b/driver/XScreenSaver.ad.in @@ -4,8 +4,8 @@ ! a screen saver and locker for the X window system ! by Jamie Zawinski ! -! version 5.43 -! 09-Jul-2019 +! version 5.44 +! 20-Mar-2020 ! ! See "man xscreensaver" for more info. The latest version is always ! available at https://www.jwz.org/xscreensaver/ @@ -323,7 +323,7 @@ XScreenSaver.bourneShell: /bin/sh *passwd.user.label: Username: *splash.heading.label: XScreenSaver %s -*splash.body.label: Copyright \251 1991-2019 by +*splash.body.label: Copyright \251 1991-2020 by *splash.body2.label: Jamie Zawinski *splash.demo.label: Settings *splash.help.label: Help @@ -445,6 +445,7 @@ XScreenSaver.bourneShell: /bin/sh @GL_KLUDGE@ GL: menger -root \n\ @GL_KLUDGE@ GL: molecule -root \n\ rotzoomer -root \n\ + scooter -root \n\ speedmine -root \n\ @GL_KLUDGE@ GL: starwars -root \n\ @GL_KLUDGE@ GL: stonerview -root \n\ @@ -577,7 +578,9 @@ XScreenSaver.bourneShell: /bin/sh @GL_KLUDGE@ GL: razzledazzle -root \n\ vfeedback -root \n\ @GL_KLUDGE@ GL: deepstars -root \n\ -@GL_KLUDGE@ GL: gravitywell -root \n +@GL_KLUDGE@ GL: gravitywell -root \n\ +@GL_KLUDGE@ GL: etruscanvenus -root \n\ +@GL_KLUDGE@ GL: gibson -root \n @@ -613,6 +616,7 @@ XScreenSaver.bourneShell: /bin/sh *hacks.dnalogo.name: DNA Logo *hacks.dymaxionmap.name: DymaxionMap *hacks.energystream.name: EnergyStream +*hacks.etruscanvenus.name: EtruscanVenus *hacks.euler2d.name: Euler2D *hacks.fadeplot.name: FadePlot *hacks.filmleader.name: FilmLeader diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c index be4a238..da98c53 100644 --- a/driver/demo-Gtk.c +++ b/driver/demo-Gtk.c @@ -1,5 +1,5 @@ /* demo-Gtk.c --- implements the interactive demo-mode and options dialogs. - * xscreensaver, Copyright (c) 1993-2019 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2020 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 @@ -550,7 +550,10 @@ warning_dialog (GtkWidget *parent, const char *message, if (!parent || !GET_WINDOW (parent)) /* too early to pop up transient dialogs */ { - fprintf (stderr, "%s: too early for dialog?\n", progname); + fprintf (stderr, + "%s: too early for warning dialog?" + "\n\n\t%s\n\n", + progname, message); free(msg); return False; } @@ -1043,7 +1046,9 @@ await_xscreensaver (state *s) strcat (buf, STFU _("You are running as root. This usually means that xscreensaver\n" "was unable to contact your X server because access control is\n" - "turned on. Try running this command:\n" + "turned on." +/* + " Try running this command:\n" "\n" " xhost +localhost\n" "\n" @@ -1053,9 +1058,10 @@ await_xscreensaver (state *s) "on to this machine to access your screen, which might be\n" "considered a security problem. Please read the xscreensaver\n" "manual and FAQ for more information.\n" + */ "\n" "You shouldn't run X as root. Instead, you should log in as a\n" - "normal user, and `su' as necessary.")); + "normal user, and `sudo' as necessary.")); else strcat (buf, _("Please check your $PATH and permissions.")); @@ -4422,7 +4428,8 @@ kde_screensaver_active_p (void) FILE *p = popen ("dcop kdesktop KScreensaverIface isEnabled 2>/dev/null", "r"); char buf[255]; - fgets (buf, sizeof(buf)-1, p); + if (!p) return False; + if (!fgets (buf, sizeof(buf)-1, p)) return False; pclose (p); if (!strcmp (buf, "true\n")) return True; @@ -4433,7 +4440,11 @@ kde_screensaver_active_p (void) static void kill_kde_screensaver (void) { - system ("dcop kdesktop KScreensaverIface enable false"); + /* Use empty body to kill warning from gcc -Wall with + "warning: ignoring return value of 'system', + declared with attribute warn_unused_result" + */ + if (system ("dcop kdesktop KScreensaverIface enable false")) {} } diff --git a/driver/lock.c b/driver/lock.c index 7696f30..d36481e 100644 --- a/driver/lock.c +++ b/driver/lock.c @@ -1400,6 +1400,8 @@ destroy_passwd_window (saver_info *si) memset (pw, 0, sizeof(*pw)); free (pw); si->pw_data = 0; + + si->unlock_dismiss_time = time((time_t *) 0); } @@ -2216,6 +2218,7 @@ Bool unlock_p (saver_info *si) { saver_preferences *p = &si->prefs; + time_t now = time ((time_t *) 0); if (!si->unlock_cb) { @@ -2225,6 +2228,18 @@ unlock_p (saver_info *si) raise_window (si, True, True, True); + /* If your cat is sitting on the return key, don't thrash the window. + Only one failed/cancelled unlock per 2 seconds. + */ + if (si->unlock_dismiss_time >= now - 1) + { + if (p->verbose_p) + fprintf (stderr, "%s: unlock: thrashing: RET held down?\n", blurb()); + XSync (si->dpy, False); +# undef sleep + sleep (2); /* This is less than ideal, but fine */ + } + xss_authenticate(si, p->verbose_p); return (si->unlock_state == ul_success); diff --git a/driver/passwd.c b/driver/passwd.c index f443726..68e1a0b 100644 --- a/driver/passwd.c +++ b/driver/passwd.c @@ -1,5 +1,5 @@ /* passwd.c --- verifying typed passwords with the OS. - * xscreensaver, Copyright (c) 1993-2018 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2019 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 @@ -251,7 +251,7 @@ do_syslog (saver_info *si, Bool verbose_p) { # ifdef HAVE_SYSLOG struct passwd *pw = getpwuid (getuid ()); - char *d = DisplayString (si->dpy); + char *d = (si->dpy ? DisplayString (si->dpy) : 0); char *u = (pw && pw->pw_name ? pw->pw_name : "???"); int opt = 0; int fac = 0; @@ -324,8 +324,9 @@ xss_authenticate(saver_info *si, Bool verbose_p) si->cached_passwd && !*si->cached_passwd) { - fprintf (stderr, "%s: assuming null password means cancel.\n", - blurb()); + if (verbose_p) + fprintf (stderr, "%s: assuming null password means cancel.\n", + blurb()); si->unlock_state = ul_cancel; } @@ -354,11 +355,11 @@ xss_authenticate(saver_info *si, Bool verbose_p) { /* If any auth method gets a cancel or timeout, don't try the next auth method! We're done! */ - fprintf (stderr, - "%s: authentication via %s %s.\n", - blurb(), methods[i].name, - (si->unlock_state == ul_cancel - ? "cancelled" : "timed out")); + if (verbose_p) + fprintf (stderr, "%s: authentication via %s %s.\n", + blurb(), methods[i].name, + (si->unlock_state == ul_cancel + ? "cancelled" : "timed out")); goto DONE; } } diff --git a/driver/prefs.c b/driver/prefs.c index 8fb029e..94e7a0c 100644 --- a/driver/prefs.c +++ b/driver/prefs.c @@ -1,5 +1,5 @@ /* dotfile.c --- management of the ~/.xscreensaver file. - * xscreensaver, Copyright (c) 1998-2018 Jamie Zawinski + * xscreensaver, Copyright (c) 1998-2020 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 @@ -136,33 +136,34 @@ init_file_name (void) if (!file) { uid_t uid = getuid (); - struct passwd *p = getpwuid (uid); + const char *home = getenv("HOME"); - if (i_am_a_nobody (uid)) - /* If we're running as nobody, then use root's .xscreensaver file - (since ~root/.xscreensaver and ~nobody/.xscreensaver are likely - to be different -- if we didn't do this, then xscreensaver-demo - would appear to have no effect when the luser is running as root.) - */ - uid = 0; - - p = getpwuid (uid); - - if (!p || !p->pw_name || !*p->pw_name) - { - fprintf (stderr, "%s: couldn't get user info of uid %d\n", - blurb(), getuid ()); - file = ""; - } - else if (!p->pw_dir || !*p->pw_dir) + if (i_am_a_nobody (uid) || !home || !*home) { - fprintf (stderr, "%s: couldn't get home directory of \"%s\"\n", - blurb(), (p->pw_name ? p->pw_name : "???")); - file = ""; + /* If we're running as nobody, then use root's .xscreensaver file + (since ~root/.xscreensaver and ~nobody/.xscreensaver are likely + to be different -- if we didn't do this, then xscreensaver-demo + would appear to have no effect when the luser is running as root.) + */ + struct passwd *p = getpwuid (uid); + uid = 0; + if (!p || !p->pw_name || !*p->pw_name) + { + fprintf (stderr, "%s: couldn't get user info of uid %d\n", + blurb(), getuid ()); + } + else if (!p->pw_dir || !*p->pw_dir) + { + fprintf (stderr, "%s: couldn't get home directory of \"%s\"\n", + blurb(), (p->pw_name ? p->pw_name : "???")); + } + else + { + home = p->pw_dir; + } } - else + if (home && *home) { - const char *home = p->pw_dir; const char *name = ".xscreensaver"; file = (char *) malloc(strlen(home) + strlen(name) + 2); strcpy(file, home); @@ -170,6 +171,10 @@ init_file_name (void) strcat(file, "/"); strcat(file, name); } + else + { + file = ""; + } } if (file && *file) @@ -1653,7 +1658,7 @@ stop_the_insanity (saver_preferences *p) if (p->watchdog_timeout > 57000) p->watchdog_timeout = 57000; /* 57 secs */ if (p->pointer_hysteresis < 0) p->pointer_hysteresis = 0; - if (p->pointer_hysteresis > 100) p->pointer_hysteresis = 100; +/* 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; diff --git a/driver/subprocs.c b/driver/subprocs.c index d500f70..e251842 100644 --- a/driver/subprocs.c +++ b/driver/subprocs.c @@ -264,8 +264,8 @@ make_job (pid_t pid, int screen, const char *cmd) clean_job_list(); AGAIN: - while (isspace(*in)) in++; /* skip whitespace */ - while (!isspace(*in) && *in != ':') { + while (*in && isspace(*in)) in++; /* skip whitespace */ + while (*in && !isspace(*in) && *in != ':') { if (*in == '=') got_eq = 1; *out++ = *in++; /* snarf first token */ } @@ -277,7 +277,7 @@ make_job (pid_t pid, int screen, const char *cmd) goto AGAIN; } - while (isspace(*in)) in++; /* skip whitespace */ + while (*in && isspace(*in)) in++; /* skip whitespace */ *out = 0; job->name = strdup(name); diff --git a/driver/timers.c b/driver/timers.c index ea97f34..5aa568c 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -1,5 +1,5 @@ /* timers.c --- detecting when the user is idle, and other timer-related tasks. - * xscreensaver, Copyright (c) 1991-2017 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2019 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 @@ -311,6 +311,12 @@ activate_lock_timer (XtPointer closure, XtIntervalId *id) if (p->verbose_p) fprintf (stderr, "%s: timed out; activating lock.\n", blurb()); + + if (!si->locked_p) + /* So that "xscreensaver-command -watch" reports the time that the + screen was locked, instead of duplicating the blank time. */ + si->blank_time = time ((time_t *) 0); + set_locked_p (si, True); } diff --git a/driver/types.h b/driver/types.h index 35992ae..ebea9e0 100644 --- a/driver/types.h +++ b/driver/types.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2019 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2020 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 @@ -275,6 +275,7 @@ struct saver_info { int unlock_failures; /* Counts failed login attempts while the screen is locked. */ time_t unlock_failure_time; /* Time of first failed login attempt. */ + time_t unlock_dismiss_time; /* Time lock dialog most recently dismissed. */ char *unlock_typeahead; /* If the screen is locked, and the user types a character, we assume that it is the first diff --git a/driver/windows.c b/driver/windows.c index b7bea52..9e47c45 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -1,5 +1,5 @@ /* windows.c --- turning the screen black; dealing with visuals, virtual roots. - * xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2020 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 @@ -1463,6 +1463,7 @@ resize_screensaver_window (saver_info *si) if (ssi->cmap) XInstallColormap (si->dpy, ssi->cmap); XMapRaised (si->dpy, ssi->screensaver_window); + XSync (si->dpy, False); if (! ssi->pid) spawn_screenhack (ssi); @@ -1586,6 +1587,7 @@ raise_window (saver_info *si, if (!dont_clear || ssi->stderr_overlay_window) clear_stderr (ssi); XMapRaised (si->dpy, ssi->screensaver_window); + XSync (si->dpy, False); #ifdef HAVE_MIT_SAVER_EXTENSION if (ssi->server_mit_saver_window && window_exists_p (si->dpy, ssi->server_mit_saver_window)) @@ -1792,15 +1794,18 @@ unblank_screen (saver_info *si) { Window focus = 0; int revert_to; + XSync (si->dpy, False); XGetInputFocus (si->dpy, &focus, &revert_to); if (focus && focus != PointerRoot && focus != None) { + XErrorHandler old_handler = XSetErrorHandler (BadWindow_ehandler); XWindowAttributes xgwa; xgwa.colormap = 0; - XGetWindowAttributes (si->dpy, focus, &xgwa); - if (xgwa.colormap && + if (XGetWindowAttributes (si->dpy, focus, &xgwa) && + xgwa.colormap && xgwa.colormap != DefaultColormapOfScreen (xgwa.screen)) XInstallColormap (si->dpy, xgwa.colormap); + XSetErrorHandler (old_handler); } } diff --git a/driver/xscreensaver-getimage-file b/driver/xscreensaver-getimage-file index ba1ef30..3a5c7f4 100755 --- a/driver/xscreensaver-getimage-file +++ b/driver/xscreensaver-getimage-file @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2001-2018 Jamie Zawinski . +# Copyright © 2001-2020 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 @@ -53,7 +53,7 @@ BEGIN { eval 'use LWP::Simple;' } my $progname = $0; $progname =~ s@.*/@@g; -my ($version) = ('$Revision: 1.52 $' =~ m/\s(\d[.\d]+)\s/s); +my ($version) = ('$Revision: 1.53 $' =~ m/\s(\d[.\d]+)\s/s); my $verbose = 0; @@ -1256,6 +1256,7 @@ sub main() { elsif (m/^--?no-spotlight$/s) { $use_spotlight_p = 0; } elsif (m/^--?cache$/s) { $cache_p = 1; } elsif (m/^--?no-?cache$/s) { $cache_p = 0; } + elsif (m/^--?flush-?cache$/s) { $feed_max_age = $cache_max_age = 0; } elsif (m/^--?cocoa$/) { $cocoa_id = shift @ARGV; } elsif (m/^--?abs(olute)?$/) { $abs_p = 1; } elsif (m/^-./) { usage; } diff --git a/driver/xscreensaver-text b/driver/xscreensaver-text index e965bed..eca1fbf 100755 --- a/driver/xscreensaver-text +++ b/driver/xscreensaver-text @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2005-2017 Jamie Zawinski +# Copyright © 2005-2019 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 @@ -37,7 +37,7 @@ use Text::Wrap qw(wrap); #use bytes; # This breaks shit. my $progname = $0; $progname =~ s@.*/@@g; -my ($version) = ('$Revision: 1.46 $' =~ m/\s(\d[.\d]+)\s/s); +my ($version) = ('$Revision: 1.48 $' =~ m/\s(\d[.\d]+)\s/s); my $verbose = 0; my $http_proxy = undef; @@ -344,6 +344,11 @@ sub output() { last if ($truncate_lines && $lines > $truncate_lines); } close $pipe; + + # I don't understand why we must do this here, but must not do this + # in the 'file' branch above, which reads the file with :raw... + utf8::decode ($body); # Pack multi-byte UTF-8 back into wide chars. + $body = reformat_text ($body); print STDOUT $body; } else { @@ -573,9 +578,10 @@ sub reformat_rss($) { foreach (@items) { $i++; - my ($title, $body1, $body2, $body3); + my ($title, $author, $body1, $body2, $body3); $title = $3 if (m@<((TITLE) [^<>\s]*)[^<>]*>\s*(.*?)\s*@xsi); + $author= $3 if (m@<((DC:CREATOR) [^<>\s]*)[^<>]*>\s*(.*?)\s*@xsi); $body1 = $3 if (m@<((DESCRIPTION) [^<>\s]*)[^<>]*>\s*(.*?)\s*@xsi); $body2 = $3 if (m@<((CONTENT) [^<>\s]*)[^<>]*>\s*(.*?)\s*@xsi); $body3 = $3 if (m@<((SUMMARY) [^<>\s]*)[^<>]*>\s*(.*?)\s*@xsi); @@ -602,10 +608,19 @@ sub reformat_rss($) { } $title = rss_field_to_html ($title || ''); + $author= rss_field_to_html ($author || ''); $body1 = rss_field_to_html ($body1 || ''); $title = '' if ($body1 eq $title); # Identical in Twitter's atom feed. + # Omit author if it's in the title or body + $author = '' if ($author && + ($title =~ m/\Q$author\E/si || + $body1 =~ m/\Q$author\E/si)); + + $title = $author if ($author && !$title); + $title = "$author: $title" if ($author && $title); + $out .= reformat_html ("$title

$body1", $wiki_p ? 'wiki' : 'rss'); $out .= "\n"; } diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c index 2add3b8..40f8207 100644 --- a/driver/xscreensaver.c +++ b/driver/xscreensaver.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski +/* xscreensaver, Copyright (c) 1991-2020 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 @@ -443,6 +443,11 @@ saver_ehandler (Display *dpy, XErrorEvent *error) } +#ifdef __GNUC__ /* Silence warning */ +static void startup_ehandler (String, String, String, String, String *, + Cardinal *) __attribute__((noreturn)); +#endif /* __GNUC__ */ + /* This error handler is used only while the X connection is being set up; after we've got a connection, we don't use this handler again. The only reason for having this is so that we can present a more idiot-proof error @@ -1561,6 +1566,7 @@ main (int argc, char **argv) if (ssi->real_screen_p) if (ensure_no_screensaver_running (si->dpy, si->screens[i].screen)) exit (1); + ssi->current_hack = -1; } lock_initialization (si, &argc, argv); @@ -1590,6 +1596,8 @@ main (int argc, char **argv) initialize_stderr (si); handle_signals (si); + store_saver_status (si); /* for xscreensaver-command -status */ + # ifdef HAVE_LIBSYSTEMD /* Launch it in the background */ si->systemd_pid = fork_and_exec_1 (si, 0, "xscreensaver-systemd"); # endif @@ -1904,13 +1912,13 @@ handle_clientmessage (saver_info *si, XEvent *event, Bool until_idle_p) "suspending."); si->selection_mode = 0; si->demoing_p = False; - si->emergency_lock_p = True; si->throttled_p = True; /* When suspending, immediately lock, if locking enabled. */ # ifndef NO_LOCKING if (p->lock_p && !si->locked_p && !si->locking_disabled_p) { + si->emergency_lock_p = True; if (p->verbose_p) fprintf (stderr, "%s: locking.\n", blurb()); set_locked_p (si, True); -- cgit v1.2.3-55-g7522