[gtk/wip/otte/dnd] colorbutton: Fix drag source
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/dnd] colorbutton: Fix drag source
- Date: Tue, 18 Feb 2020 02:00:56 +0000 (UTC)
commit 0d4d4e9a8cce34d42e0eb2596288ba16ddf95411
Author: Benjamin Otte <otte redhat com>
Date: Tue Feb 18 02:58:58 2020 +0100
colorbutton: Fix drag source
By running it in the capture phase, it will not be starved for events by
the button's click source and make drags actually start a color drag
operation.
gtk/gtkcolorbutton.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index 86c81830f5..9c951d21ae 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -328,6 +328,7 @@ gtk_color_button_init (GtkColorButton *button)
source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (gtk_color_button_drag_prepare), button);
g_signal_connect (source, "drag-begin", G_CALLBACK (gtk_color_button_drag_begin), button);
+ gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (source), GTK_PHASE_CAPTURE);
gtk_widget_add_controller (priv->button, GTK_EVENT_CONTROLLER (source));
gtk_widget_add_css_class (priv->button, "color");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]