From 54264a9f78044c27d65208c52f00c2d97369ad5c Mon Sep 17 00:00:00 2001 From: "g.willems" Date: Mon, 11 Mar 2024 20:32:59 +0100 Subject: [PATCH] paned: don't claim drag-begin on invisible handle Paned handles are hidden when any of its children are hidden too, but drag events were still accepted around the (virtual) handle position. Instead, deny drag-begin when handle is hidden. Fixes #6520 Closes #6520 --- gtk/gtkpaned.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 154f2f2863..5c30aad390 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -886,6 +886,14 @@ gesture_drag_begin_cb (GtkGestureDrag *gesture, GdkDevice *device; gboolean is_touch; + /* Only drag the handle when it's visible */ + if (!gtk_widget_get_child_visible (paned->handle_widget)) + { + gtk_gesture_set_state (GTK_GESTURE (gesture), + GTK_EVENT_SEQUENCE_DENIED); + return; + } + sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence); device = gdk_event_get_device (event);