[gtk/wip/carlosg/for-master: 2/8] gtk/modelbutton: Handle unpaired releases
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/carlosg/for-master: 2/8] gtk/modelbutton: Handle unpaired releases
- Date: Sat, 12 Dec 2020 00:43:16 +0000 (UTC)
commit 5155fac94f815d362fa02c9f2548c3c166663962
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Dec 11 16:59:07 2020 +0100
gtk/modelbutton: Handle unpaired releases
Let model buttons handle unpaired releases, these may happen indirectly
e.g. due to other child menus being opened at the time. Clicking would
dismiss the menu, but the menu item beneath the pointer would not get
activated.
We can handle that button release though via ::unpaired-release, so
there's no second click required.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3463
gtk/gtkmodelbutton.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 6c6be9a123..b644a7fe61 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -1493,6 +1493,7 @@ gtk_model_button_init (GtkModelButton *self)
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_PRIMARY);
g_signal_connect (gesture, "pressed", G_CALLBACK (gesture_pressed), self);
g_signal_connect_swapped (gesture, "released", G_CALLBACK (emit_clicked), self);
+ g_signal_connect_swapped (gesture, "unpaired-release", G_CALLBACK (emit_clicked), self);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_CAPTURE);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]