summaryrefslogtreecommitdiffstats
path: root/CRT.c
diff options
context:
space:
mode:
authornia <nia@NetBSD.org>2021-07-14 20:17:13 +0200
committerBenBE <BenBE@geshi.org>2021-07-15 19:09:08 +0200
commit2ab8fb83ba7d210c7c377b5b417f79822a6f7724 (patch)
treef83599c5be12b94271f16482316e8cfcba8ef9aa /CRT.c
parentd45b4f4a4328ced5e291e6c309437599647c02e0 (diff)
netbsd: Support curses libraries without ncurses mouse support
This adds a configure check for the ncurses getmouse() function and disables mouse-related code paths when mouse support is not present in the curses library. This is necessary for stable versions of NetBSD's libcurses, the development version has stub mouse functions for compatibility with ncurses. Signed-off-by: Nia Alarie <nia@NetBSD.org>
Diffstat (limited to 'CRT.c')
-rw-r--r--CRT.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/CRT.c b/CRT.c
index 16cfd63a..4bd409c1 100644
--- a/CRT.c
+++ b/CRT.c
@@ -836,7 +836,9 @@ void CRT_init(const Settings* settings, bool allowUnicode) {
nonl();
intrflush(stdscr, false);
keypad(stdscr, true);
+#ifdef HAVE_GETMOUSE
mouseinterval(0);
+#endif
curs_set(0);
if (has_colors()) {
@@ -910,11 +912,13 @@ void CRT_init(const Settings* settings, bool allowUnicode) {
#endif
CRT_treeStrAscii;
+#ifdef HAVE_GETMOUSE
#if NCURSES_MOUSE_VERSION > 1
mousemask(BUTTON1_RELEASED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL);
#else
mousemask(BUTTON1_RELEASED, NULL);
#endif
+#endif
CRT_degreeSign = initDegreeSign();
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy