aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-02-24 03:00:53 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-02-24 03:11:59 +0300
commit00dd53661570996c637d0d4b28188427e04f22bc (patch)
treef1ed22ed2f29038e3eb2d728daf37c030fa22fe5
parente89593076f488e9e113cc58a5050b7283eedfb6c (diff)
downloadsciteco-00dd53661570996c637d0d4b28188427e04f22bc.tar.gz
Gtk: fixed MOUSE macro invocation when detecting double/triple clicks
* At the SciTECO API level (-nEJ), there are no double clicks. We must therefore ignore the GDK_2BUTTON_PRESS and GDK_3BUTTON_PRESS events, that are delivered when GTK detects double or triple clicks. They are only sent in addition to GDK_BUTTON_PRESS, so it's safe to simply ignore them. * This was causing spurious RELEASED events, which were confusing the ^KMOUSE macro from fnkeys.tes, causing the wrong buffer range to be inserted into the command line.
-rw-r--r--src/interface-gtk/interface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 9c740a6..a41890d 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -1126,9 +1126,13 @@ teco_interface_handle_mouse_button(GdkEventButton *event, GError **error)
teco_mouse.type = TECO_MOUSE_PRESSED;
break;
case GDK_BUTTON_RELEASE:
- default:
teco_mouse.type = TECO_MOUSE_RELEASED;
break;
+ case GDK_2BUTTON_PRESS:
+ case GDK_3BUTTON_PRESS:
+ default:
+ /* delivered in addition to GDK_BUTTON_PRESS */
+ return TRUE;
}
teco_mouse.x = event->x;