From 00dd53661570996c637d0d4b28188427e04f22bc Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 24 Feb 2025 03:00:53 +0300 Subject: 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. --- src/interface-gtk/interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/interface-gtk/interface.c') 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; -- cgit v1.2.3