|
|
|
@ -1145,7 +1145,12 @@ coerce_styles(fbuf* f, const tinfo* ti, uint16_t* curstyle,
|
|
|
|
|
static inline int
|
|
|
|
|
mouse_enable(tinfo* ti, FILE* out){
|
|
|
|
|
if(ti->qterm == TERMINAL_LINUX){
|
|
|
|
|
return gpm_connect(ti);
|
|
|
|
|
if(ti->gpmfd >= 0){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if((ti->gpmfd = gpm_connect(ti)) >= 0){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Sets the shift-escape option, allowing shift+mouse to override the standard
|
|
|
|
|
// mouse protocol (mainly so copy-and-paste can still be performed).
|
|
|
|
@ -1159,6 +1164,10 @@ mouse_enable(tinfo* ti, FILE* out){
|
|
|
|
|
static inline int
|
|
|
|
|
mouse_disable(tinfo* ti, fbuf* f){
|
|
|
|
|
if(ti->qterm == TERMINAL_LINUX){
|
|
|
|
|
if(ti->gpmfd < 0){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
ti->gpmfd = -1;
|
|
|
|
|
return gpm_close(ti);
|
|
|
|
|
}
|
|
|
|
|
return fbuf_emit(f, "\x1b[?" SET_BTN_EVENT_MOUSE ";"
|
|
|
|
|