commit 94aeaccdbda835f0d5cd89b7217b744f71719030
parent 0738f39cf040287eab03b52474c974907ea53f97
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Sat, 3 Feb 2024 21:42:28 +0530
Fix #1765: detect and ignore false mouse click
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/nnn.c b/src/nnn.c
@@ -1312,14 +1312,14 @@ static char *abspath(const char *filepath, char *cwd, char *buf)
}
/* finds abspath of link pointed by filepath, taking cwd into account */
-static char *bmtarget(const char *filepath, char *cwd, char *buf)
+static char *bmtarget(const char *filepath, char *cwd, char *buf)
{
char target[PATH_MAX + 1];
ssize_t n = readlink(filepath, target, PATH_MAX);
if (n != -1) {
target[n] = '\0';
return abspath(target, cwd, buf);
- }
+ }
return NULL;
}
@@ -3436,7 +3436,14 @@ static int filterentries(char *path, char *lastname)
continue;
#ifndef NOMOUSE
case KEY_MOUSE:
+ {
+ MEVENT event = {0};
+ getmouse(&event);
+ if (event.bstate == 0)
+ continue;
+ ungetmouse(&event);
goto end;
+ }
#endif
case ESC:
if (handle_alt_key(ch) != ERR) {