[brownbag] actually call mouse_{dis/en}able()

This commit is contained in:
nick black 2021-07-09 08:15:08 -04:00
parent 2dd1e8812e
commit 087fd083af
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 8 additions and 4 deletions

View File

@ -2,6 +2,8 @@ This document attempts to list user-visible changes and any major internal
rearrangements of Notcurses.
* 2.3.9 (not yet released)
* Fixed two major regressions in 2.3.8: menu highlighting is working once
more, as are pointer inputs (mice). Sorry about that!
* `notcurses_detected_terminal()` and `ncdirect_detected_terminal()` now
both return a heap-allocated string, which will contain the terminal
version if Notcurses was able to detect it. This result ought be free()d.

View File

@ -1152,14 +1152,14 @@ static inline int
mouse_enable(FILE* out){
return term_emit("\x1b[?" SET_BTN_EVENT_MOUSE ";"
/*SET_FOCUS_EVENT_MOUSE ";" */SET_SGR_MODE_MOUSE "h",
out, false);
out, true);
}
static inline int
mouse_disable(FILE* out){
return term_emit("\x1b[?" SET_BTN_EVENT_MOUSE ";"
/*SET_FOCUS_EVENT_MOUSE ";" */SET_SGR_MODE_MOUSE "l",
out, false);
out, true);
}
// how many edges need touch a corner for it to be printed?

View File

@ -2161,7 +2161,8 @@ ncplane* ncplane_above(ncplane* n){
}
int notcurses_mouse_enable(notcurses* n){
if(n->ttyfd >= 0){
if(mouse_enable(n->ttyfp)){
return -1;
}
return 0;
}
@ -2169,7 +2170,8 @@ int notcurses_mouse_enable(notcurses* n){
// this seems to work (note difference in suffix, 'l' vs 'h'), but what about
// the sequences 1000 etc?
int notcurses_mouse_disable(notcurses* n){
if(n->ttyfd >= 0){
if(mouse_disable(n->ttyfp)){
return -1;
}
return 0;
}