diff --git a/xscreensaver-6.00-0005-blurb-show-1-100-sec-on-linux.patch b/xscreensaver-6.00-0005-blurb-show-1-100-sec-on-linux.patch new file mode 100644 index 0000000..219d696 --- /dev/null +++ b/xscreensaver-6.00-0005-blurb-show-1-100-sec-on-linux.patch @@ -0,0 +1,55 @@ +From 6c6c990727caa881b7b3f045dfaa0a167d347507 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +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 + diff --git a/xscreensaver-6.00-0006-jwz-duplicate-events.patch b/xscreensaver-6.00-0006-jwz-duplicate-events.patch new file mode 100644 index 0000000..5704ec5 --- /dev/null +++ b/xscreensaver-6.00-0006-jwz-duplicate-events.patch @@ -0,0 +1,55 @@ +From 822cd458d0027fddc9f391587d8e6db1a4ce8002 Mon Sep 17 00:00:00 2001 +From: Jamie Zawinski +Date: Tue, 4 May 2021 10:05:18 +0900 +Subject: [PATCH] init_xinput: remove duplicate event for multiple screen + +--- + driver/xinput.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/driver/xinput.c b/driver/xinput.c +index 3b21db02..c64ee212 100644 +--- a/driver/xinput.c ++++ b/driver/xinput.c +@@ -117,6 +117,28 @@ init_xinput (Display *dpy, int *opcode_ret) + } + + ++/* If there is more than one Screen on the Display, XInput2 sends an event for ++ each Screen. You'd think that they would have the 'root' member set to the ++ root window of that screen, so that we could ignore events not destined for ++ our screen, but no, they have the same root window. But they also have the ++ same 'serial' and 'time', so we can ignore the duplicates by noticing ++ recently-duplicated event serial numbers, which ought never happen. ++ */ ++static Bool ++duplicate_xinput_event_p (XIDeviceEvent *in) ++{ ++ static unsigned long dups[50] = { 0, }; /* No more than N screens */ ++ int i; ++ for (i = 0; i < countof(dups); i++) ++ if (dups[i] == in->serial) ++ return True; ++ for (i = 0; i < countof(dups)-1; i++) ++ dups[i] = dups[i+1]; ++ dups[i] = in->serial; ++ return False; ++} ++ ++ + /* Convert an XInput2 event to corresponding old-school Xlib event. + Returns true on success. + */ +@@ -225,6 +247,9 @@ xinput_event_to_xlib (int evtype, XIDeviceEvent *in, XEvent *out) + break; + } + ++ if (duplicate_xinput_event_p (in)) ++ ok = False; ++ + return ok; + } + +-- +2.31.1 + diff --git a/xscreensaver.spec b/xscreensaver.spec index 1a19825..289dd24 100644 --- a/xscreensaver.spec +++ b/xscreensaver.spec @@ -11,7 +11,7 @@ %define split_getimage 1 %endif -%define fedora_rel 2 +%define fedora_rel 3 %global use_clang_as_cc 0 %global use_clang_analyze 0 @@ -97,11 +97,16 @@ Patch3607: xscreensaver-5.36-0007-misc-kill-gcc-warn_unused_result-warning Patch5002: xscreensaver-6.00-0002-xscreensaver-text-use-en_US-locale-for-lscpu.patch # fontglide.c: pick_font_1 exclude substitution rectagle glyph Patch5004: xscreensaver-6.00-0004-fontglide.c-pick_font_1-exclude-substitution-rectagl.patch +# init_xinput: remove duplicate event for multiple screen +# bug 1954884, patch from the upstream +Patch5006: xscreensaver-6.00-0006-jwz-duplicate-events.patch # Fedora specific # window_init: search parenthesis first for searching year Patch10001: xscreensaver-6.00-0001-screensaver_id-search-parenthesis-first-for-searchin.patch # dialog.c: window_init: show more version string Patch10003: xscreensaver-6.00-0003-dialog.c-window_init-show-more-version-string.patch +# blurb: show 1/100 sec on linux +Patch10005: xscreensaver-6.00-0005-blurb-show-1-100-sec-on-linux.patch # # gcc warning cleanup # Some cppcheck cleanup @@ -379,6 +384,8 @@ find . -name \*.c -exec chmod ugo-x {} \; %__cat %PATCH5002 | %__git am %__cat %PATCH10003 | %__git am %__cat %PATCH5004 | %__git am +#%%__cat %PATCH10005 | %__git am +%__cat %PATCH5006 | %__git am #%%__cat %PATCH13501 | %%__git am @@ -1117,6 +1124,10 @@ exit 0 %endif %changelog +* Tue May 4 2021 Mamoru TASAKA - 1:6.00-3 +- init_xinput: remove duplicate event for multiple screen + patch from the upstream (bug 1954884) + * Mon May 3 2021 Mamoru TASAKA - 1:6.00-2 - xscreensaver-text use en_US locale for lscpu (bug 1956089) - dialog.c: window_init: show more version string (bug 1956262)