From 03747a476bfdfaa99675a33785fcaa01328cd146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 16 Feb 2021 22:48:58 +0000 Subject: [PATCH 1/5] systemd from Fedora --- contrib/systemd/gpm.service | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 contrib/systemd/gpm.service diff --git a/contrib/systemd/gpm.service b/contrib/systemd/gpm.service new file mode 100644 index 0000000..4860727 --- /dev/null +++ b/contrib/systemd/gpm.service @@ -0,0 +1,14 @@ +[Unit] +Description=Console Mouse manager + +# This could probably benefit from socket activation, but honestly I think it +# is time for gpm to go away, and hence I am not planning to spend the time +# to add socket activation here. + +[Service] +ExecStart=/usr/sbin/gpm -m /dev/input/mice -t exps2 +Type=forking +PIDFile=/run/gpm.pid + +[Install] +WantedBy=multi-user.target From 646e840676197ef3da8d587ca49b1decf1a4e937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 16 Feb 2021 22:50:36 +0000 Subject: [PATCH 2/5] rhbz-668480-gpm-types-7-manpage-fixes.patch --- doc/doc.gpm.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/doc.gpm.in b/doc/doc.gpm.in index 795b958..fb3eee9 100644 --- a/doc/doc.gpm.in +++ b/doc/doc.gpm.in @@ -600,7 +600,7 @@ error. When the document refer to ``standard serial options'' it means that one of @t{\-o dtr}, @t{\-o rts}, @t{\-o both} can be specified to toggle the control lines of the serial port. -The following mouse type are corrently recognized: +The following mouse type are currently recognized: @table @code @item bare Microsoft @@ -621,7 +621,7 @@ The following mouse type are corrently recognized: this is your case, use the @samp{bare} mouse type. Some new two-button devices are ``plug and play'', and they don't play fair at all; in this case try @t{\-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to + three-button devices that use the Microsoft protocol fail to report some middle-button events during mouse motion. Since the protocol does not distinguish between the middle button going up and the middle button going down it would be liable @@ -649,7 +649,7 @@ The following mouse type are corrently recognized: decoder gets into a confused state where it thinks the middle button is up when it's down and vice versa. (If you get sick of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft + mouse! Note that most three-button mice that do the Microsoft protocol can be made to do the MouseSystems protocol instead. The ``3 Button Serial Mouse mini-HOWTO'' has information about this.) This mouse decoder accepts standard From d68f8267f1c7af7922f1488920b370d37a1affdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 16 Feb 2021 22:52:06 +0000 Subject: [PATCH 3/5] gpm-1.20.5-close-fds.patch --- src/daemon/startup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/daemon/startup.c b/src/daemon/startup.c index 1d00255..4d85e8c 100644 --- a/src/daemon/startup.c +++ b/src/daemon/startup.c @@ -135,6 +135,13 @@ void startup(int argc, char **argv) check_uniqueness(); gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); + // close extra fds + if (option.run_status == GPM_RUN_STARTUP ) { + close(0); + close(1); + close(2); + } + //return mouse_table[1].fd; /* the second is handled in the main() */ /****************** OLD CODE from gpn.c END ***********************/ From 389bbcebcf6b61dc0af2de1a72352bb124303b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 16 Feb 2021 22:54:14 +0000 Subject: [PATCH 4/5] gpm-1.20.1-weak-wgetch.patch --- configure.ac.footer | 2 +- src/lib/libcurses.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac.footer b/configure.ac.footer index 1e5e4da..d3953e1 100644 --- a/configure.ac.footer +++ b/configure.ac.footer @@ -129,7 +129,7 @@ No|no|N|n) SHARED_LIBS=-lc ;; AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) else :; fi done - SHARED_LIBS="$LIBS $TERMLIBS -lc" + SHARED_LIBS="-lc" LIBS=$SAVELIBS ;; esac diff --git a/src/lib/libcurses.c b/src/lib/libcurses.c index e7ebf84..814cce5 100644 --- a/src/lib/libcurses.c +++ b/src/lib/libcurses.c @@ -41,7 +41,12 @@ #endif /* HAVE_NCURSES_CURSES_H */ #endif /* HAVE_NCURSES_H */ -#define GET(win) ((win) ? wgetch(win) : getch()) +/* If win != NULL, it must have been created by ncurses anyway. + Avoid circular library dependencies. */ +#pragma weak wgetch +#pragma weak stdscr + +#define GET(win) ((win && wgetch) ? wgetch(win) : getch()) int Gpm_Wgetch(WINDOW *win) { From c110031321f9f2d99f66ed3187693c73c66e45d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 16 Feb 2021 22:55:02 +0000 Subject: [PATCH 5/5] gpm-1.20.1-lib-silent.patch --- src/lib/report-lib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/report-lib.c b/src/lib/report-lib.c index 03230b4..85d7642 100644 --- a/src/lib/report-lib.c +++ b/src/lib/report-lib.c @@ -24,8 +24,16 @@ #include "headers/message.h" +static int gpm_silent() { + if ( getenv( "GPM_VERBOSE" ) == NULL ) return 1; + return 0; +} + void gpm_report(int line, const char *file, int stat, const char *text, ... ) { + if ( gpm_silent() && stat != GPM_STAT_OOPS ) + return; + const char *string = NULL; int log_level; va_list ap;