mc: Fix mouse after ncurses 6.1 (fixes #2112)
authorFredrik Fornwall <fredrik@fornwall.net>
Thu, 8 Feb 2018 23:08:00 +0000 (00:08 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Thu, 8 Feb 2018 23:08:00 +0000 (00:08 +0100)
packages/mc/build.sh
packages/mc/lib-tty-key.c.patch [new file with mode: 0644]

index 418a487..782b2a1 100755 (executable)
@@ -1,6 +1,7 @@
 TERMUX_PKG_HOMEPAGE=https://www.midnight-commander.org/
 TERMUX_PKG_DESCRIPTION="Midnight Commander - a powerful file manager"
 TERMUX_PKG_VERSION=4.8.20
+TERMUX_PKG_REVISION=1
 TERMUX_PKG_SHA256=017ee7f4f8ae420a04f4d6fcebaabe5b494661075c75442c76e9c8b1923d501c
 TERMUX_PKG_SRCURL=http://ftp.midnight-commander.org/mc-${TERMUX_PKG_VERSION}.tar.xz
 TERMUX_PKG_DEPENDS="libandroid-support, ncurses, glib"
diff --git a/packages/mc/lib-tty-key.c.patch b/packages/mc/lib-tty-key.c.patch
new file mode 100644 (file)
index 0000000..b95bb61
--- /dev/null
@@ -0,0 +1,22 @@
+The code assumes that "kmous" capability is for X10 mouse reporting,
+so if an event for kmous happens it tries to decode it according to
+the X10 protocol.
+
+This breaks starting with ncurses 6.1 as the terminfo for xterm
+started using the SGR sequence for xterm in 6.1.
+
+This is a hacky, non-invasive patch which just assumes that the SGR
+protocol is used.
+
+diff -u -r ../mc-4.8.20/lib/tty/key.c ./lib/tty/key.c
+--- ../mc-4.8.20/lib/tty/key.c 2017-03-04 18:51:38.000000000 +0100
++++ ./lib/tty/key.c    2018-02-08 23:19:38.207353992 +0100
+@@ -2140,7 +2140,7 @@
+                           || c == MCKEY_EXTENDED_MOUSE))
+     {
+         /* Mouse event */
+-        xmouse_get_event (event, c == MCKEY_EXTENDED_MOUSE);
++        xmouse_get_event (event, 1);
+         c = (event->type != 0) ? EV_MOUSE : EV_NONE;
+     }
+     else if (c == MCKEY_BRACKETED_PASTING_START)