From 865ad9410077b2db6b5c47ab3b9693657a5a0ae0 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Thu, 29 Jun 2006 01:38:58 +0000
Subject: [PATCH] in get_mouseinput(), handle both releases and clicks of mouse
 button 1, as the mouse support works better that way

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3689 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   | 2 +-
 src/winio.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8fcfc134..669230fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,7 +6,7 @@ CVS code -
 	  -W/--wordbounds.  Changes to usage(), nano.1, nanorc.5,
 	  rnano.1, nano.texi, and nanorc.sample.in. (DLR)
 	- Fix mouse support so that it really ignores everything except
-	  releases of button 1 (i.e, left clicks).  Changes to
+	  releases and clicks of button 1.  Changes to
 	  enable_mouse_support() and get_mouseinput(). (DLR)
 - browser.c:
   do_browser()
diff --git a/src/winio.c b/src/winio.c
index 204127c8..15d61331 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -1520,9 +1520,9 @@ bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
     if (getmouse(&mevent) == ERR)
 	return FALSE;
 
-    /* If it's not a release of the first mouse button (i.e, a left
-     * click), get out. */
-    if (!(mevent.bstate & BUTTON1_RELEASED))
+    /* If it's not a release or click of the first mouse button, get
+     * out. */
+    if (!(mevent.bstate & (BUTTON1_RELEASED | BUTTON1_CLICKED)))
 	return FALSE;
 
     /* Save the screen coordinates where the mouse event took place. */
-- 
GitLab