Browse Source

xscreensaver version update 6.04

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 2 years ago
commit
acd5dc15b1
  1. 11297
      SOURCES/ja.po
  2. 92
      SOURCES/update-xscreensaver-hacks
  3. 84
      SOURCES/xscreensaver-5.35-0101-XIO-print-C-backtrace-on-error.patch
  4. 56
      SOURCES/xscreensaver-5.35-webcollage-default-nonet.patch
  5. 96
      SOURCES/xscreensaver-5.36-0007-misc-kill-gcc-warn_unused_result-warnings.patch
  6. 126
      SOURCES/xscreensaver-5.45-0001-barcode-glsnake-sanitize-the-names-of-modes.patch
  7. 48
      SOURCES/xscreensaver-6.00-0001-screensaver_id-search-parenthesis-first-for-searchin.patch
  8. 27
      SOURCES/xscreensaver-6.00-0003-dialog.c-window_init-show-more-version-string.patch
  9. 55
      SOURCES/xscreensaver-6.00-0005-blurb-show-1-100-sec-on-linux.patch
  10. 84
      SOURCES/xscreensaver-6.03-0001-print_xinput_event-check-if-XIRawEvent.raw_values-is.patch
  11. 10
      SOURCES/xscreensaver-autostart
  12. 6
      SOURCES/xscreensaver-autostart.desktop
  13. 28
      SOURCES/xscreensaver-newlogin-wrapper
  14. 2684
      SPECS/xscreensaver.spec

11297
SOURCES/ja.po

File diff suppressed because it is too large Load Diff

92
SOURCES/update-xscreensaver-hacks

@ -0,0 +1,92 @@ @@ -0,0 +1,92 @@
#!/bin/bash

_SYSCONFDIR=${sysconfdir:-/etc}
_PREFIX=${prefix:-/usr}
_DATADIR=${datadir:-${_PREFIX}/share}

ADDIR=${ADDIR:-${install_prefix}${_SYSCONFDIR}/xscreensaver}
CONFDIR=${CONFDIR:-${install_prefix}${_DATADIR}/xscreensaver/hacks.conf.d}
ADFILE=${ADFILE:-$ADDIR/XScreenSaver.ad}

fix_hackconf ()
{
if [ ! -s $1 ] ; then
echo "$1 is empty" >&2
echo ""
return 1
fi

tmpconf=`mktemp /tmp/hackconf.XXXXXXXX`
tmpconf_1=`mktemp /tmp/hackconf.XXXXXXXX`
tmpconf_2=`mktemp /tmp/hackconf.XXXXXXXX`
tmpconf_3=`mktemp /tmp/hackconf.XXXXXXXX`
sed -n -e '$p' $1 > $tmpconf_1
sed -e '$d' $1 > $tmpconf_2
for file in $tmpconf_1 $tmpconf_2 ; do
if ( [ -s $file ] && grep -q '\\n\(\|\\\)[^\\].*$' $file ) ; then
rm -f $tmpconf $tmpconf_1 $tmpconf_2 $tmpconf_3
echo ""
echo "ignoring $1" >&2
return 1
fi
done
if ! grep -q '\\n[\\]*$' $tmpconf_1 ; then
sed -i -e 's|\(^.*$\)|\1 \\n\\|' $tmpconf_1
fi
sed -i -e 's|\\n$|\\n\\|' $tmpconf_1
while [ -s $tmpconf_2 ] ; do
sed -n -e '1p' $tmpconf_2 > $tmpconf_3
sed -i -e '1d' $tmpconf_2
if ! grep -q '\([ \t]\\$\|\\n\\$\)' $tmpconf_3 ; then
rm -f $tmpconf $tmpconf_1 $tmpconf_2 $tmpconf_3
echo ""
echo "ignoring $1" >&2
return 1
fi
cat $tmpconf_3 >> $tmpconf
done
cat $tmpconf_1 >> $tmpconf
rm -f $tmpconf_1 $tmpconf_2 $tmpconf_3
echo $tmpconf
return 0
}

for suffix in header tail ; do
if [ ! -r $ADDIR/XScreenSaver.ad.$suffix ] ; then
echo "$ADDIR/XScreenSaver.ad.$suffix missing"
exit 1
fi
done

tmpfile=`mktemp /tmp/XScreenSaver.ad.XXXXXXXX`

cat > $tmpfile <<EOF
! Don't edit this file directly by yourself!!
! This file is not meant to be edited directly.
!
! Instead, please edit /etc/xscreensaver/XScreenSaver.ad.header,
! /etc/xscreensaver/XScreenSaver.ad.tail and add files under
! /usr/share/xscreensaver/hacks.conf.d if you want.
!
! Then call /usr/sbin/update-xscreensaver-hacks to
! update this file.
!
EOF

cat $ADDIR/XScreenSaver.ad.header >> $tmpfile

for hackconf in $CONFDIR/*.conf ; do
hackconf_fixed=`fix_hackconf $hackconf`
if [ -n "$hackconf_fixed" ] ; then
cat $hackconf_fixed >> $tmpfile
rm -f $hackconf_fixed
fi
done
sed -i -e '$s|\\n\\$|\\n|' $tmpfile

cat $ADDIR/XScreenSaver.ad.tail >> $tmpfile
install -c -p -m 644 $tmpfile $ADFILE
rm -f $tmpfile


84
SOURCES/xscreensaver-5.35-0101-XIO-print-C-backtrace-on-error.patch

@ -0,0 +1,84 @@ @@ -0,0 +1,84 @@
From 735cc1af7595890d9cd567f36dabaf41fae4210e Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Mon, 11 Jul 2016 16:53:14 +0900
Subject: [PATCH] XIO: print C backtrace on error

For debugging purpose, show C backtrace with XIO
error happens.
---
driver/xscreensaver.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c
index 76969f2..04c2669 100644
--- a/driver/xscreensaver.c
+++ b/driver/xscreensaver.c
@@ -148,10 +148,15 @@
# include "config.h"
#endif
+#include <features.h>
#include <stdio.h>
#include <ctype.h>
#include <X11/Xlib.h>
+#ifdef __GNU_LIBRARY__
+#include <execinfo.h>
+#endif
+
#ifdef ENABLE_NLS
# include <locale.h>
# include <libintl.h>
@@ -504,6 +509,41 @@ startup_ehandler (String name, String type, String class,
exit (1);
}
+static void
+show_cstyle_backtrace(void)
+{
+#ifdef __GNU_LIBRARY__
+ void *bt_array[128];
+ size_t bt_size;
+
+ bt_size = backtrace(bt_array, countof(bt_array));
+ fprintf(stderr, "C backtrace:\n");
+ backtrace_symbols_fd(bt_array, bt_size, STDERR_FILENO);
+#endif
+}
+
+static int (*default_xio_ehandler)(Display *dpy) = 0;
+
+static int
+show_debug_info_xio_ehandler(Display *dpy)
+{
+ show_cstyle_backtrace();
+ if (default_xio_ehandler){
+ (*default_xio_ehandler)(dpy);
+ }
+ return 0;
+}
+
+static void
+hack_IOErrorHandler(void)
+{
+#ifdef __GNU_LIBRARY__
+ XIOErrorHandler old_handler;
+ old_handler = XSetIOErrorHandler(show_debug_info_xio_ehandler);
+ default_xio_ehandler = old_handler;
+#endif
+}
+
/* The zillions of initializations.
*/
@@ -1570,6 +1610,7 @@ main (int argc, char **argv)
initialize_stderr (si);
handle_signals (si);
+ hack_IOErrorHandler();
make_splash_dialog (si);
--
2.7.4

56
SOURCES/xscreensaver-5.35-webcollage-default-nonet.patch

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
From b04424419b281e608bac2a600bf7aab0c65b164a Mon Sep 17 00:00:00 2001
From: XScreenSaver owners <xscreensaver-owner@fedoraproject.org>
Date: Tue, 24 Mar 2020 13:29:14 +0900
Subject: [PATCH] # Change webcollage not to access to net # Also see bug
472061

---
hacks/config/webcollage.xml | 7 ++++++-
hacks/webcollage.man | 5 +++++
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/hacks/config/webcollage.xml b/hacks/config/webcollage.xml
index c26ea98..da312fa 100644
--- a/hacks/config/webcollage.xml
+++ b/hacks/config/webcollage.xml
@@ -30,8 +30,8 @@
<string id="filter" _label="Per-image filter program" arg="-filter %"/>
<string id="filter2" _label="Overall filter program" arg="-filter2 %"/>
<file id="dictionary" _label="Dictionary file" arg="-dictionary %"/>
- <file id="dir" _label="Image directory" arg="-directory %"/>
-->
+ <file id="dir" _label="Image directory" arg="-directory %"/>
<xscreensaver-updater />
@@ -51,6 +51,11 @@ Please act accordingly.
See also https://www.jwz.org/webcollage/
+NOTE:
+Webcollage on Fedora does not connect to internet by default
+and uses image files on your local disk. If you want webcollage to
+search for image files on net, use webcollage.original .
+
Written by Jamie Zawinski; 1999.
</_description>
</screensaver>
diff --git a/hacks/webcollage.man b/hacks/webcollage.man
index 82bf5d7..7860d2e 100644
--- a/hacks/webcollage.man
+++ b/hacks/webcollage.man
@@ -178,6 +178,11 @@ the given directory.
.TP 8
.B \-fps
Display the current frame rate and CPU load (MacOS only).
+.SH NOTES FOR FEDORA USER
+Webcollage on Fedora uses '-directory' option by default, so it
+.B does not connect to internet
+and uses image files on your local disk. If you want webcollage to
+search for image files on net, use webcollage.original .
.SH ENVIRONMENT
.PP
.TP 8
--
2.25.2

96
SOURCES/xscreensaver-5.36-0007-misc-kill-gcc-warn_unused_result-warnings.patch

@ -0,0 +1,96 @@ @@ -0,0 +1,96 @@
From 0d26e4514d7d6c90d2c5e35749c0b83121a66b77 Mon Sep 17 00:00:00 2001
From: "mtasaka@fedoraproject.org" <mtasaka@fedoraproject.org>
Date: Tue, 7 Feb 2017 16:40:52 +0900
Subject: [PATCH] misc: kill gcc warn_unused_result warnings

Remove misc warnings generated gcc -Wall with
"warning: ignoring return value of 'foo',
declared with attribute warn_unused_result".

For setuid() and fgets(), really check the returned value.
For system(), for now just use empty body to avoid this
warning. Note that casting the result to (void) does not
remove these warnings.
---
driver/demo-Gtk.c | 9 +++++++--
hacks/glx/sonar-icmp.c | 2 +-
hacks/glx/sonar.c | 5 +++--
hacks/recanim.c | 6 +++++-
4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c
index f5c4839..7c34846 100644
--- a/driver/demo-Gtk.c
+++ b/driver/demo-Gtk.c
@@ -4423,7 +4423,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;
@@ -4434,7 +4435,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/hacks/glx/sonar-icmp.c b/hacks/glx/sonar-icmp.c
index 8256270..26eb90d 100644
--- a/hacks/glx/sonar-icmp.c
+++ b/hacks/glx/sonar-icmp.c
@@ -1634,7 +1634,7 @@ sonar_init_ping (Display *dpy, char **error_ret, char **desc_ret,
fprintf (stderr, "%s: unable to open icmp socket\n", progname);
/* Disavow privs */
- setuid(getuid());
+ if (setuid(getuid()) == -1) abort();
pd->pid = getpid() & 0xFFFF;
pd->seq = 0;
diff --git a/hacks/glx/sonar.c b/hacks/glx/sonar.c
index f3a4d9d..2c6ca5b 100644
--- a/hacks/glx/sonar.c
+++ b/hacks/glx/sonar.c
@@ -930,8 +930,9 @@ init_sensor (ModeInfo *mi)
sp->ssd = sonar_init_ping (MI_DISPLAY (mi), &sp->error, &sp->desc,
ping_arg, ping_timeout, resolve_p, times_p,
debug_p);
- else
- setuid(getuid()); /* Disavow privs if not pinging. */
+ else {
+ if (setuid(getuid()) == -1) abort(); /* Disavow privs if not pinging. */
+ }
sp->start_time = double_time (); /* for error message timing */
diff --git a/hacks/recanim.c b/hacks/recanim.c
index 51379ed..a526c25 100644
--- a/hacks/recanim.c
+++ b/hacks/recanim.c
@@ -324,7 +324,11 @@ screenhack_record_anim_free (record_anim_state *st)
" 2>&-",
fn);
fprintf (stderr, "%s: exec: %s\n", progname, cmd);
- system (cmd);
+ /* Use empty body to kill warning from gcc -Wall with
+ "warning: ignoring return value of 'system',
+ declared with attribute warn_unused_result"
+ */
+ if (system (cmd)) {}
if (stat (fn, &s))
{
--
2.9.3

126
SOURCES/xscreensaver-5.45-0001-barcode-glsnake-sanitize-the-names-of-modes.patch

@ -0,0 +1,126 @@ @@ -0,0 +1,126 @@
From d8ba605b7779ce5d2fc893c44fc2986ecf176e47 Mon Sep 17 00:00:00 2001
From: XScreenSaver owners <xscreensaver-owner@fedoraproject.org>
Date: Wed, 9 Dec 2020 22:12:09 +0900
Subject: [PATCH] barcode / glsnake: sanitize the names of modes

---
hacks/barcode.c | 10 ----------
hacks/glx/glsnake.c | 12 ++++++------
2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/hacks/barcode.c b/hacks/barcode.c
index 20c2f38..ba3e2b2 100644
--- a/hacks/barcode.c
+++ b/hacks/barcode.c
@@ -122,8 +122,6 @@ static const char *words[] =
"bird flu",
"bliss",
"bogosity",
- "boobies",
- "boobs",
"booty",
"bread",
"brogrammers",
@@ -139,7 +137,6 @@ static const char *words[] =
"chocolate",
"chupacabra",
"CLONE",
- "cock",
"congress",
"constriction",
"contrition",
@@ -184,7 +181,6 @@ static const char *words[] =
"fear",
"fever",
"filth",
- "flatulence",
"fluff",
"fnord",
"followers",
@@ -202,9 +198,7 @@ static const char *words[] =
"happiness",
"hate",
"helplessness",
- "hemorrhoid",
"hermaphrodite",
- "heroin",
"heroine",
"hope",
"hysteria",
@@ -286,7 +280,6 @@ static const char *words[] =
"punishment",
"punk rock",
"punk",
- "pussy",
"quagmire",
"quarantine",
"quartz",
@@ -295,7 +288,6 @@ static const char *words[] =
"rage",
"readout",
"reality",
- "rectum",
"reject",
"rejection",
"respect",
@@ -365,8 +357,6 @@ static const char *words[] =
"venom",
"verifiability",
"very fine people",
- "viagra",
- "vibrator",
"victim",
"vignette",
"villainy",
diff --git a/hacks/glx/glsnake.c b/hacks/glx/glsnake.c
index 8efc681..125df90 100644
--- a/hacks/glx/glsnake.c
+++ b/hacks/glx/glsnake.c
@@ -539,7 +539,7 @@ static const struct model_s model[] = {
PIN, ZERO, RIGHT, RIGHT, ZERO, PIN, PIN, ZERO, PIN, PIN, ZERO,
RIGHT, ZERO }
},
- { "k's turd",
+ { "caterpillar",
{ RIGHT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT,
RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN,
RIGHT, LEFT, RIGHT, PIN, ZERO }
@@ -564,22 +564,22 @@ static const struct model_s model[] = {
ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
ZERO, ZERO, ZERO }
},
- { "kissy box",
+ { "ribbon",
{ PIN, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
ZERO, PIN, ZERO }
},
- { "erect penis", /* thanks benno */
+ { "shuffle board", /* thanks benno */
{ PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
PIN, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO,
ZERO, ZERO }
},
- { "flaccid penis",
+ { "anchor",
{ PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
PIN, ZERO, ZERO, ZERO, RIGHT, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
ZERO, ZERO }
},
- { "vagina",
+ { "engagement ring",
{ RIGHT, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, PIN, ZERO, ZERO,
LEFT, ZERO, ZERO, ZERO, LEFT, ZERO, LEFT, PIN, LEFT, PIN, RIGHT,
PIN, RIGHT, ZERO }
@@ -999,7 +999,7 @@ static const struct model_s model[] = {
{ "Parrot",
{ ZERO, ZERO, ZERO, ZERO, RIGHT, RIGHT, ZERO, LEFT, PIN, RIGHT, ZERO, RIGHT, ZERO, RIGHT, ZERO, RIGHT, PIN, LEFT, ZERO, RIGHT, LEFT, ZERO, PIN, ZERO }
},
- { "Penis",
+ { "Shuttle",
{ PIN, PIN, RIGHT, ZERO, PIN, PIN, ZERO, PIN, ZERO, ZERO, RIGHT, PIN, LEFT, ZERO, ZERO, PIN, ZERO, PIN, PIN, ZERO, LEFT, PIN, PIN, ZERO }
},
{ "PictureComingSoon",
--
2.29.2

48
SOURCES/xscreensaver-6.00-0001-screensaver_id-search-parenthesis-first-for-searchin.patch

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
From ef72c9500015a36bf0b4b412337ec2d890d092b6 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Fri, 2 Apr 2021 18:46:14 +0900
Subject: [PATCH] screensaver_id: search parenthesis first for searching year

Fedora package modifies screensaver_id string to %%version-%%release .
Adjust window_init function so that "year" information is
parsed correctly.
---
driver/dialog.c | 4 +++-
driver/xscreensaver-systemd.c | 4 +++-
3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/driver/dialog.c b/driver/dialog.c
index fce74c4..9a8173f 100644
--- a/driver/dialog.c
+++ b/driver/dialog.c
@@ -949,8 +949,10 @@ window_init (Widget root_widget, Bool splash_p)
/* Put the version number in the label. */
{
char *version = strdup (screensaver_id + 17);
- char *year = strchr (version, '-');
+ char *year;
char *s = strchr (version, ' ');
+ year = strchr (version, '('); /* Search parenthesis first */
+ year = strchr (year, '-');
*s = 0;
year = strchr (year+1, '-') + 1;
s = strchr (year, ')');
diff --git a/driver/xscreensaver-systemd.c b/driver/xscreensaver-systemd.c
index d06174a..c9a66a1 100644
--- a/driver/xscreensaver-systemd.c
+++ b/driver/xscreensaver-systemd.c
@@ -950,8 +950,10 @@ main (int argc, char **argv)
{
int i;
char *version = strdup (screensaver_id + 17);
- char *year = strchr (version, '-');
+ char *year;
char *s = strchr (version, ' ');
+ year = strchr (version, '('); /* Search parenthesis first */
+ year = strchr (year, '-');
*s = 0;
year = strchr (year+1, '-') + 1;
s = strchr (year, ')');
--
2.31.1

27
SOURCES/xscreensaver-6.00-0003-dialog.c-window_init-show-more-version-string.patch

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
From 13e1203d8cc00a8462dbd2656257b46b411b2854 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Mon, 3 May 2021 15:00:31 +0900
Subject: [PATCH] dialog.c: window_init: show more version string

Fedora modifies version string to "6.00-1.fc34" to show rpm "release", for example.
Let's allow more length for version string for password dialog.
---
driver/dialog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/driver/dialog.c b/driver/dialog.c
index 9a8173f..3020880 100644
--- a/driver/dialog.c
+++ b/driver/dialog.c
@@ -959,7 +959,7 @@ window_init (Widget root_widget, Bool splash_p)
*s = 0;
ws->heading_label = (char *) malloc (100);
ws->version = strdup(version);
- sprintf (ws->heading_label, "XScreenSaver %.4s, v%.10s", year, version);
+ sprintf (ws->heading_label, "XScreenSaver %.4s, v%.14s", year, version);
if (splash_p)
{
--
2.31.1

55
SOURCES/xscreensaver-6.00-0005-blurb-show-1-100-sec-on-linux.patch

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
From 6c6c990727caa881b7b3f045dfaa0a167d347507 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Tue, 4 May 2021 09:58:54 +0900
Subject: [PATCH] blurb: show 1/100 sec on linux

---
driver/blurb.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/driver/blurb.c b/driver/blurb.c
index d732a9b..010923b 100644
--- a/driver/blurb.c
+++ b/driver/blurb.c
@@ -28,8 +28,23 @@ blurb (void)
struct tm tm;
time_t now;
int i;
+#ifdef __linux__
+ struct timespec tp;
+ unsigned int sec_per_100 = 0;
+#endif
+
+#ifdef __linux__
+ if ( (clock_gettime(CLOCK_REALTIME_COARSE, &tp)) == 0 )
+ {
+ now = tp.tv_sec;
+ sec_per_100 = tp.tv_nsec / 10000000; /* 10^9 / 10^7 */
+ }
+ else
+#endif
+ {
+ now = time ((time_t *) 0);
+ }
- now = time ((time_t *) 0);
localtime_r (&now, &tm);
i = strlen (progname);
if (i > 40) i = 40;
@@ -44,6 +59,13 @@ blurb (void)
buf[i++] = ':';
buf[i++] = '0' + (tm.tm_sec >= 10 ? tm.tm_sec/10 : 0);
buf[i++] = '0' + (tm.tm_sec % 10);
+
+#ifdef __linux__
+ buf[i++] = '.';
+ buf[i++] = '0' + (sec_per_100 >= 10 ? sec_per_100/10 : 0);
+ buf[i++] = '0' + (sec_per_100 % 10);
+#endif
+
buf[i] = 0;
return buf;
}
--
2.31.1

84
SOURCES/xscreensaver-6.03-0001-print_xinput_event-check-if-XIRawEvent.raw_values-is.patch

@ -0,0 +1,84 @@ @@ -0,0 +1,84 @@
From 9086681b0775ad92ce39df96d22ff5a3fe06c68f Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Fri, 4 Mar 2022 11:24:49 +0900
Subject: [PATCH] print_xinput_event: check if XIRawEvent.raw_values is
available

gcc12 -sanitize=address shows that XIRawEvent.raw_values is not always
available.
XIRawEvent buffer is allocated on wireToRawEvent() in XExtInt.c in libXi.
Follow wireToRawEvent() implementation to check is XIRawEvent.raw_values
is available, using XIRawEvent.valuators.mask_len, valuators.mask and
XIMaskIsSet.
---
driver/xinput.c | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/driver/xinput.c b/driver/xinput.c
index 9402a4f..2ce2ce1 100644
--- a/driver/xinput.c
+++ b/driver/xinput.c
@@ -296,6 +296,30 @@ print_kbd_event (XEvent *xev, XComposeStatus *compose, Bool x11_p)
}
}
+/* see wireToRawEvent, count_bits in libXi and XIMaskIsSet in X11/extensions/XI2.h */
+static void
+print_xi_raw_event_raw_values (XIRawEvent *re)
+{
+ int mask_pos;
+ double *raw_values_pos = re->raw_values;
+ int first_time_p;
+
+ first_time_p = 1;
+
+ for (mask_pos = 0; mask_pos < re->valuators.mask_len * sizeof(char); mask_pos++)
+ {
+ if (XIMaskIsSet(re->valuators.mask, mask_pos))
+ {
+ if (first_time_p)
+ {
+ first_time_p = 0;
+ fprintf(stderr, " %7.02f", *raw_values_pos++);
+ } else {
+ fprintf(stderr, ", %-7.02f", *raw_values_pos++);
+ }
+ }
+ }
+}
void
print_xinput_event (Display *dpy, XEvent *xev, const char *desc)
@@ -371,11 +395,12 @@ print_xinput_event (Display *dpy, XEvent *xev, const char *desc)
XQueryPointer (dpy, DefaultRootWindow (dpy),
&root_ret, &child_ret, &root_x, &root_y,
&win_x, &win_y, &mask);
- fprintf (stderr, "%s: XI _RawButton%s %4d, %-4d %7.02f, %-7.02f\n",
+ fprintf (stderr, "%s: XI _RawButton%s %4d, %-4d",
blurb(),
(re->evtype == XI_RawButtonPress ? "Press " : "Release"),
- root_x, root_y,
- re->raw_values[0], re->raw_values[1]);
+ root_x, root_y);
+ print_xi_raw_event_raw_values(re);
+ fprintf(stderr, "\n");
}
break;
@@ -390,9 +415,10 @@ print_xinput_event (Display *dpy, XEvent *xev, const char *desc)
&root_ret, &child_ret, &root_x, &root_y,
&win_x, &win_y, &mask);
fprintf (stderr,
- "%s: XI_RawMotion %4d, %-4d %7.02f, %-7.02f%s\n",
- blurb(), root_x, root_y, re->raw_values[0], re->raw_values[1],
- (desc ? desc : ""));
+ "%s: XI_RawMotion %4d, %-4d ",
+ blurb(), root_x, root_y);
+ print_xi_raw_event_raw_values(re);
+ fprintf (stderr, "%s\n", (desc ? desc : ""));
}
break;
--
2.35.1

10
SOURCES/xscreensaver-autostart

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/bin/sh

# Don't launch xscreensaver if gnome-screensaver
# is installed

if [ -x /usr/bin/gnome-screensaver ] ; then exit 0 ; fi
if [ -x /usr/bin/mate-screensaver ] ; then exit 0 ; fi
if [ -x /usr/bin/xfce4-screensaver ] ; then exit 0 ; fi

exec xscreensaver -nosplash

6
SOURCES/xscreensaver-autostart.desktop

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
[Desktop Entry]
Type=Application
Name=xscreensaver-autostart
Comment=Autostart xscreensaver
Exec=/usr/libexec/xscreensaver-autostart
Terminal=false

28
SOURCES/xscreensaver-newlogin-wrapper

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
#!/usr/bin/bash

is_process_running_p()
{
pidid=$(pidof "$1" | sed -e 's|[ \t].*||')
if [ "x${pidid}" == "x" ] ; then
return 1
else
return 0
fi
}

check_manager_and_exec() {
is_process_running_p "$1" || return
exec $2
}

check_manager_and_exec "lxdm-binary" "lxdm -c USER_SWITCH" # LXDE
check_manager_and_exec "lightdm" "dm-tool switch-to-greeter" # XFCE and etc
check_manager_and_exec "gdm" "gdmflexiserver -ls" # GNOME
# KDE-like
check_manager_and_exec "sddm" \
"qdbus --system org.freedesktop.DisplayManager /org/freedesktop/DisplayManager/Seat0 org.freedesktop.DisplayManager.Seat.SwitchToGreeter"


# No registered login manager found
exit 1

2684
SPECS/xscreensaver.spec

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save