diff --git a/xscreensaver-6.00-0008-xinput_event_to_xlib-don-t-call-duplicate_xinput_eve.patch b/xscreensaver-6.00-0008-xinput_event_to_xlib-don-t-call-duplicate_xinput_eve.patch new file mode 100644 index 0000000..7d9580f --- /dev/null +++ b/xscreensaver-6.00-0008-xinput_event_to_xlib-don-t-call-duplicate_xinput_eve.patch @@ -0,0 +1,96 @@ +From 6f060462d5d0d505802a82c43102b1612a493d7c Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Wed, 12 May 2021 22:55:46 +0900 +Subject: [PATCH] xinput_event_to_xlib: don't call duplicate_xinput_event_p + when debug mode + +When xscreensaver is running with -debug option, +in gui_main_loop in dialog.c, print_xinput_event is called (when debug mode), +which calls xinput_event_to_xlib, which calls duplicate_xinput_event_p . +Later gui_main_loop calls xinput_event_to_xlib (when debug mode or not), +here xinput events are always considered as duplicate. + +When xinput_event_to_xlib is called from print_xinput_event, don't check +duplicate event. +--- + driver/dialog.c | 2 +- + driver/test-xinput.c | 3 ++- + driver/xinput.c | 7 ++++--- + driver/xinput.h | 2 +- + 4 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/driver/dialog.c b/driver/dialog.c +index 3020880..e571627 100644 +--- a/driver/dialog.c ++++ b/driver/dialog.c +@@ -2192,7 +2192,7 @@ gui_main_loop (window_state *ws, Bool splash_p, Bool notification_p) + { + XEvent ev2; + Bool ok = +- xinput_event_to_xlib (xev.xcookie.evtype, xev.xcookie.data, &ev2); ++ xinput_event_to_xlib (xev.xcookie.evtype, xev.xcookie.data, &ev2, True); + XFreeEventData (ws->dpy, &xev.xcookie); + if (ok) + xev = ev2; +diff --git a/driver/test-xinput.c b/driver/test-xinput.c +index e3a6487..57667a5 100644 +--- a/driver/test-xinput.c ++++ b/driver/test-xinput.c +@@ -242,7 +242,8 @@ main (int argc, char **argv) + XEvent ev2; + Bool ok = xinput_event_to_xlib (xev.xcookie.evtype, + (XIDeviceEvent *) re, +- &ev2); ++ &ev2, ++ True); + if (!ok) + fprintf (stderr, "%s: unable to translate XInput2 event\n", + blurb()); +diff --git a/driver/xinput.c b/driver/xinput.c +index c64ee21..8ddb6bf 100644 +--- a/driver/xinput.c ++++ b/driver/xinput.c +@@ -143,7 +143,7 @@ duplicate_xinput_event_p (XIDeviceEvent *in) + Returns true on success. + */ + Bool +-xinput_event_to_xlib (int evtype, XIDeviceEvent *in, XEvent *out) ++xinput_event_to_xlib (int evtype, XIDeviceEvent *in, XEvent *out, Bool check_duplicate_p) + { + Display *dpy = in->display; + Bool ok = False; +@@ -247,7 +247,7 @@ xinput_event_to_xlib (int evtype, XIDeviceEvent *in, XEvent *out) + break; + } + +- if (duplicate_xinput_event_p (in)) ++ if (check_duplicate_p && duplicate_xinput_event_p (in)) + ok = False; + + return ok; +@@ -348,7 +348,8 @@ print_xinput_event (Display *dpy, XEvent *xev, const char *desc) + XEvent ev2; + Bool ok = xinput_event_to_xlib (xev->xcookie.evtype, + (XIDeviceEvent *) re, +- &ev2); ++ &ev2, ++ False); + if (!ok) + fprintf (stderr, "%s: unable to translate XInput2 event\n", blurb()); + else +diff --git a/driver/xinput.h b/driver/xinput.h +index 2ee20ee..93dcd6e 100644 +--- a/driver/xinput.h ++++ b/driver/xinput.h +@@ -13,7 +13,7 @@ + #define __XSCREENSAVER_XINPUT_H__ + + extern Bool init_xinput (Display *dpy, int *opcode_ret); +-extern Bool xinput_event_to_xlib (int evtype, XIDeviceEvent *in, XEvent *out); ++extern Bool xinput_event_to_xlib (int evtype, XIDeviceEvent *in, XEvent *out, Bool check_duplicate_p); + extern void print_xinput_event (Display *, XEvent *, const char *desc); + + #endif /* __XSCREENSAVER_XINPUT_H__ */ +-- +2.31.1 + diff --git a/xscreensaver-6.00-0009-duplicate_xinput_event_p-show-some-debug-message.patch b/xscreensaver-6.00-0009-duplicate_xinput_event_p-show-some-debug-message.patch new file mode 100644 index 0000000..9f0a35f --- /dev/null +++ b/xscreensaver-6.00-0009-duplicate_xinput_event_p-show-some-debug-message.patch @@ -0,0 +1,31 @@ +From 5c7669fa892d7d1f3d177ed2ba7bd95cb91ef6d0 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Wed, 12 May 2021 23:46:08 +0900 +Subject: [PATCH] duplicate_xinput_event_p: show some debug message + +--- + driver/xinput.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/driver/xinput.c b/driver/xinput.c +index 8ddb6bf..7e38104 100644 +--- a/driver/xinput.c ++++ b/driver/xinput.c +@@ -129,9 +129,14 @@ duplicate_xinput_event_p (XIDeviceEvent *in) + { + static unsigned long dups[50] = { 0, }; /* No more than N screens */ + int i; ++ if (debug_p) ++ fprintf(stderr, "%s: serial is %ld\n", blurb(), in->serial); + for (i = 0; i < countof(dups); i++) + if (dups[i] == in->serial) ++ { ++ if (debug_p) fprintf(stderr, "%s: serial duplicate with %d\n", blurb(), i); + return True; ++ } + for (i = 0; i < countof(dups)-1; i++) + dups[i] = dups[i+1]; + dups[i] = in->serial; +-- +2.31.1 + diff --git a/xscreensaver.spec b/xscreensaver.spec index 8d58fae..f23471b 100644 --- a/xscreensaver.spec +++ b/xscreensaver.spec @@ -11,7 +11,7 @@ %define split_getimage 1 %endif -%define fedora_rel 4 +%define fedora_rel 4.3 %global use_clang_as_cc 0 %global use_clang_analyze 0 @@ -102,13 +102,17 @@ Patch5004: xscreensaver-6.00-0004-fontglide.c-pick_font_1-exclude-substitut Patch5006: xscreensaver-6.00-0006-jwz-duplicate-events.patch # fontglide.c: drain_input: terminate with null explicitly Patch5007: xscreensaver-6.00-0007-fontglide.c-drain_input-terminate-with-null-explicit.patch +# xinput_event_to_xlib: don't call duplicate_xinput_event_p when debug mode +Patch5008: xscreensaver-6.00-0008-xinput_event_to_xlib-don-t-call-duplicate_xinput_eve.patch # Fedora specific # window_init: search parenthesis first for searching year -Patch10001: xscreensaver-6.00-0001-screensaver_id-search-parenthesis-first-for-searchin.patch +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 +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 +Patch10005: xscreensaver-6.00-0005-blurb-show-1-100-sec-on-linux.patch +#duplicate_xinput_event_p: show some debug message +Patch10009: xscreensaver-6.00-0009-duplicate_xinput_event_p-show-some-debug-message.patch # # gcc warning cleanup # Some cppcheck cleanup @@ -386,8 +390,11 @@ find . -name \*.c -exec chmod ugo-x {} \; %__cat %PATCH5002 | %__git am %__cat %PATCH10003 | %__git am %__cat %PATCH5004 | %__git am -#%%__cat %PATCH10005 | %__git am +%__cat %PATCH10005 | %__git am %__cat %PATCH5006 | %__git am +%__cat %PATCH5007 | %__git am +%__cat %PATCH5008 | %__git am +%__cat %PATCH10009 | %__git am #%%__cat %PATCH13501 | %%__git am @@ -702,7 +709,7 @@ cp -a ../hacks/fonts hacks # Workaround for ppc64 build failure make -C ../hacks/images -j1 for dir in \ - utils driver ../hacks/images hacks hacks/glx po + utils driver ../hacks/images hacks/images hacks hacks/glx po do %__make %{?_smp_mflags} -k \ -C $dir \ @@ -1126,6 +1133,9 @@ exit 0 %endif %changelog +* Wed May 12 2021 Mamoru TASAKA - 1:6.00-5 +- input_event_to_xlib: don't call duplicate_xinput_event_p when debug mode + * Wed May 5 2021 Mamoru TASAKA - 1:6.00-4 - fontglide.c: drain_input: terminate with null explicitly