Skip to content

Commit

Permalink
mc: fix mouse support with newer ncurses (#5205)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka authored Feb 11, 2025
1 parent e2e1b6e commit 6adeee9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgname=mc
pkgver=4.8.33
pkgrel=1
pkgrel=2
pkgdesc="Midnight Commander is a text based filemanager/shell that emulates Norton Commander"
arch=('i686' 'x86_64')
url="https://www.midnight-commander.org/"
Expand Down Expand Up @@ -30,10 +30,12 @@ backup=('etc/mc/edit.indent.rc'
'etc/mc/sfs.ini')
source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/MidnightCommander/${pkgname}/archive/${pkgver}.tar.gz"
4.7.5.2-ncursesw-term.h.patch
0003-vfs-win32-absolute-paths.patch)
0003-vfs-win32-absolute-paths.patch
mc-4.8.26-ncurses-mouse.patch)
sha256sums=('092e440930fda43574739e45a8b41af384b974e6720184b6707d127b84082c51'
'49e9a7d918088c8760b0090e99cd6257fa56efa3a4d3e6c9166270cda9c2e8e3'
'fc33fcde6ead0406df9df2292804bd5f2d18fb05fc8b51a827f6abb1f6266b54')
'fc33fcde6ead0406df9df2292804bd5f2d18fb05fc8b51a827f6abb1f6266b54'
'f0051e60b3634f61c8253ffc9d31353f1c7d5eaa1484c456cc1616a2e04b2c64')
noextract=(${pkgname}-${pkgver}.tar.gz)

prepare() {
Expand All @@ -50,6 +52,10 @@ prepare() {
patch -Np2 -i "${srcdir}/4.7.5.2-ncursesw-term.h.patch"
patch -Np0 -i "${srcdir}/0003-vfs-win32-absolute-paths.patch"

# https://midnight-commander.org/ticket/4144
# https://gitweb.gentoo.org/repo/gentoo.git/tree/app-misc/mc/files/mc-4.8.26-ncurses-mouse.patch
patch -p1 -i "${srcdir}/mc-4.8.26-ncurses-mouse.patch"

./autogen.sh
}

Expand Down
16 changes: 16 additions & 0 deletions mc/mc-4.8.26-ncurses-mouse.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Fix mouse-key input with ncurses6 in terminals without basic X10 mouse
support, at the cost of breaking it with ncurses5. See discussion in
https://midnight-commander.org/ticket/4144 .

--- a/lib/tty/key.c
+++ b/lib/tty/key.c
@@ -2124,8 +2124,7 @@
gboolean extended = c == MCKEY_EXTENDED_MOUSE;

#ifdef KEY_MOUSE
- extended = extended || (c == KEY_MOUSE && xmouse_seq == NULL
- && xmouse_extended_seq != NULL);
+ extended = extended || (c == KEY_MOUSE && xmouse_extended_seq != NULL);
#endif /* KEY_MOUSE */

xmouse_get_event (event, extended);

0 comments on commit 6adeee9

Please sign in to comment.