mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-24 15:15:44 +00:00
Call mousemask(3X) to truly enable or disable mouse control
This commit is contained in:
parent
ef4cbae5ea
commit
d22667725a
1
Action.c
1
Action.c
@ -88,6 +88,7 @@ static void Action_runSetup(State* st) {
|
||||
ScreenManager_run(scr, NULL, NULL, "Setup");
|
||||
ScreenManager_delete(scr);
|
||||
if (st->settings->changed) {
|
||||
CRT_setMouse(st->settings->enableMouse);
|
||||
Header_writeBackToSettings(st->header);
|
||||
}
|
||||
}
|
||||
|
22
CRT.c
22
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user