From aae3cda8b30c61112f6eed9a401f16f9e7bdbe15 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 11 Nov 2021 06:26:30 -0500 Subject: [PATCH] [mouse] don't send command when mouseproto == 0 #2339 --- src/lib/mice.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/mice.c b/src/lib/mice.c index 0ae74b4fb..930bee980 100644 --- a/src/lib/mice.c +++ b/src/lib/mice.c @@ -32,6 +32,9 @@ int mouse_setup(tinfo* ti, unsigned eventmask){ }else if(eventmask & NCMICE_BUTTON_EVENT){ ti->mouseproto = '0'; // SET_X11_MOUSE_PROT }else if(eventmask == 0){ + if(ti->mouseproto == 0){ + return 0; + } command = 'l'; } // Sets the shift-escape option, allowing shift+mouse to override the standard @@ -40,6 +43,9 @@ int mouse_setup(tinfo* ti, unsigned eventmask){ char mousecmd[] = XTSHIFTESCAPE "\x1b[?100x;" SET_SGR_MOUSE_PROT "x"; mousecmd[11] = ti->mouseproto; mousecmd[17] = command; + if(command == 'l'){ + ti->mouseproto = 0; + } return tty_emit(mousecmd, ti->ttyfd); #undef XTSHIFTESCAPE }