summaryrefslogtreecommitdiffstats
path: root/CRT.c
diff options
context:
space:
mode:
authorWHR <msl0000023508@gmail.com>2022-05-17 12:53:15 +0800
committerBenBE <BenBE@geshi.org>2022-05-19 20:23:22 +0200
commitd22667725a980e75a3c635567ec5c9400bcde02b (patch)
tree60aa1ddfb56d9c212972f7a49e3d169dba944031 /CRT.c
parentef4cbae5ea7d327b8ba27dedd645bd7b86b5fd88 (diff)
Call mousemask(3X) to truly enable or disable mouse control
Diffstat (limited to 'CRT.c')
-rw-r--r--CRT.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/CRT.c b/CRT.c
index 583b6266..868f2377 100644
--- a/CRT.c
+++ b/CRT.c
@@ -900,6 +900,20 @@ void CRT_resetSignalHandlers(void) {
signal(SIGQUIT, SIG_DFL);
}
+void CRT_setMouse(bool enabled) {
+#ifdef HAVE_GETMOUSE
+ if (enabled) {
+#if NCURSES_MOUSE_VERSION > 1
+ mousemask(BUTTON1_RELEASED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL);
+#else
+ mousemask(BUTTON1_RELEASED, NULL);
+#endif
+ } else {
+ mousemask(0, NULL);
+ }
+#endif
+}
+
void CRT_init(const Settings* settings, bool allowUnicode) {
redirectStderr();
@@ -993,13 +1007,7 @@ IGNORE_WCASTQUAL_END
#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_setMouse(settings->enableMouse);
CRT_degreeSign = initDegreeSign();
}

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