From 1b5e0071bb210db67c6c846b9c91926fb6073852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 9 Aug 2022 20:12:08 +0200 Subject: Restore non mouse support Closes: #1061 --- CRT.c | 4 ++-- CRT.h | 4 ++++ CommandLine.c | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CRT.c b/CRT.c index f010658b..8686b547 100644 --- a/CRT.c +++ b/CRT.c @@ -900,8 +900,8 @@ void CRT_resetSignalHandlers(void) { signal(SIGQUIT, SIG_DFL); } -void CRT_setMouse(bool enabled) { #ifdef HAVE_GETMOUSE +void CRT_setMouse(bool enabled) { if (enabled) { #if NCURSES_MOUSE_VERSION > 1 mousemask(BUTTON1_RELEASED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL); @@ -911,8 +911,8 @@ void CRT_setMouse(bool enabled) { } else { mousemask(0, NULL); } -#endif } +#endif void CRT_init(const Settings* settings, bool allowUnicode) { redirectStderr(); diff --git a/CRT.h b/CRT.h index 297e8964..c06d3ae7 100644 --- a/CRT.h +++ b/CRT.h @@ -185,7 +185,11 @@ extern int CRT_scrollWheelVAmount; extern ColorScheme CRT_colorScheme; +#ifdef HAVE_GETMOUSE void CRT_setMouse(bool enabled); +#else +#define CRT_setMouse(enabled) +#endif void CRT_init(const Settings* settings, bool allowUnicode); diff --git a/CommandLine.c b/CommandLine.c index 9749158b..ee9047d2 100644 --- a/CommandLine.c +++ b/CommandLine.c @@ -79,7 +79,9 @@ typedef struct CommandLineSettings_ { int sortKey; int delay; bool useColors; +#ifdef HAVE_GETMOUSE bool enableMouse; +#endif bool treeView; bool allowUnicode; bool highlightChanges; @@ -96,7 +98,9 @@ static CommandLineStatus parseArguments(const char* program, int argc, char** ar .sortKey = 0, .delay = -1, .useColors = true, +#ifdef HAVE_GETMOUSE .enableMouse = true, +#endif .treeView = false, .allowUnicode = true, .highlightChanges = false, -- cgit v1.2.3