aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-04-18 06:02:27 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-04-18 06:02:27 +0300
commit816d2a300b24ce65a908e251be13b3f1b93cfa81 (patch)
treea11df07b74a1488230a8b7c8228f1518d34334f6
parentd7ca88be9655a28132ab66d3359d4331bf460eef (diff)
downloadsciteco-816d2a300b24ce65a908e251be13b3f1b93cfa81.tar.gz
Gtk: prevent drag-and-drop interaction and block more possibly dangerous touch and scroll events
* You could drag and drop text into the Scintilla views, which would confuse SciTECO. * In the future, we might actually want to support programmable drag-and-drop support via special key macros.
-rw-r--r--src/interface-gtk/view.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/interface-gtk/view.c b/src/interface-gtk/view.c
index ef839d6..5bc4b61 100644
--- a/src/interface-gtk/view.c
+++ b/src/interface-gtk/view.c
@@ -97,10 +97,21 @@ teco_view_new(void)
gtk_widget_set_can_focus(GTK_WIDGET(ctx), FALSE);
gint events = gtk_widget_get_events(GTK_WIDGET(ctx));
events &= ~(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_SCROLL_MASK |
+ GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
+#ifdef GDK_VERSION_3_18
+ GDK_TOUCHPAD_GESTURE_MASK |
+#endif
+#ifdef GDK_VERSION_3_22
+ GDK_TABLET_PAD_MASK |
+#endif
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
gtk_widget_set_events(GTK_WIDGET(ctx), events);
+ /*
+ * Disables drag and drop interaction.
+ */
+ gtk_drag_dest_unset(GTK_WIDGET(ctx));
+
return (teco_view_t *)ctx;
}