[gtk/dnd-gestures-2: 173/173] Update all users
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/dnd-gestures-2: 173/173] Update all users
- Date: Thu, 9 Jan 2020 00:03:28 +0000 (UTC)
commit 1c03bbeb9c4e37989f3c1c2eb14a1621f93d4286
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jan 8 17:07:30 2020 -0500
Update all users
gtk/gtkcalendar.c | 2 +-
gtk/gtkexpander.c | 2 +-
gtk/gtkfilechooserwidget.c | 4 ++--
gtk/gtkiconview.c | 2 +-
gtk/gtknotebook.c | 2 +-
gtk/gtkplacessidebar.c | 2 +-
gtk/gtkstackswitcher.c | 2 +-
gtk/gtktext.c | 2 +-
gtk/gtktextview.c | 2 +-
gtk/gtktreeview.c | 2 +-
tests/testdnd.c | 6 +++---
tests/testdnd2.c | 34 ++++++++++++++++++++++++++++++++++
tests/testdnd3.c | 2 +-
13 files changed, 49 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 703692bc2d..8d9d36fa88 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -792,7 +792,7 @@ gtk_calendar_init (GtkCalendar *calendar)
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
gdk_content_formats_unref (formats);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_calendar_drag_motion), calendar);
+ g_signal_connect (dest, "accept", G_CALLBACK (gtk_calendar_drag_motion), calendar);
g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_calendar_drag_leave), calendar);
g_signal_connect (dest, "drag-drop", G_CALLBACK (gtk_calendar_drag_drop), calendar);
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index ba00716e86..68d0a19652 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -379,7 +379,7 @@ gtk_expander_init (GtkExpander *expander)
formats = gdk_content_formats_new (NULL, 0);
dest = gtk_drop_target_new (formats, 0);
gdk_content_formats_unref (formats);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_expander_drag_motion), expander);
+ g_signal_connect (dest, "accept", G_CALLBACK (gtk_expander_drag_motion), expander);
g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_expander_drag_leave), expander);
gtk_widget_add_controller (GTK_WIDGET (expander), GTK_EVENT_CONTROLLER (dest));
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index fbfdc32e82..38fc967dfb 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -2052,7 +2052,7 @@ file_list_drag_motion_cb (GtkDropTarget *dest,
int y,
GtkFileChooserWidget *impl)
{
- g_signal_stop_emission_by_name (dest, "drag-motion");
+ g_signal_stop_emission_by_name (dest, "accept");
return TRUE;
}
@@ -8497,7 +8497,7 @@ post_process_ui (GtkFileChooserWidget *impl)
GDK_ACTION_COPY | GDK_ACTION_MOVE);
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY | GDK_ACTION_MOVE);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (file_list_drag_motion_cb), impl);
+ g_signal_connect (dest, "accept", G_CALLBACK (file_list_drag_motion_cb), impl);
g_signal_connect (dest, "drag-drop", G_CALLBACK (file_list_drag_drop_cb), impl);
gtk_widget_add_controller (priv->browse_files_tree_view, GTK_EVENT_CONTROLLER (dest));
gdk_content_formats_unref (formats);
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index d997c4cd00..94e30bee6e 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -6457,7 +6457,7 @@ gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
icon_view->priv->dest = gtk_drop_target_new (formats, actions);
g_signal_connect (icon_view->priv->dest, "drag-leave", G_CALLBACK (gtk_icon_view_drag_leave), icon_view);
- g_signal_connect (icon_view->priv->dest, "drag-motion", G_CALLBACK (gtk_icon_view_drag_motion), icon_view);
+ g_signal_connect (icon_view->priv->dest, "accept", G_CALLBACK (gtk_icon_view_drag_motion), icon_view);
g_signal_connect (icon_view->priv->dest, "drag-drop", G_CALLBACK (gtk_icon_view_drag_drop), icon_view);
gtk_widget_add_controller (GTK_WIDGET (icon_view), GTK_EVENT_CONTROLLER (icon_view->priv->dest));
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 26735ad8e2..a160ccb4eb 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1349,7 +1349,7 @@ gtk_notebook_init (GtkNotebook *notebook)
targets = gdk_content_formats_new (dst_notebook_targets, G_N_ELEMENTS (dst_notebook_targets));
dest = gtk_drop_target_new (targets, GDK_ACTION_MOVE);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_notebook_drag_motion), NULL);
+ g_signal_connect (dest, "accept", G_CALLBACK (gtk_notebook_drag_motion), NULL);
g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_notebook_drag_leave), NULL);
g_signal_connect (dest, "drag-drop", G_CALLBACK (gtk_notebook_drag_drop), NULL);
gtk_widget_add_controller (GTK_WIDGET (priv->tabs_widget), GTK_EVENT_CONTROLLER (dest));
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 71210ea086..aad2385b60 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -4088,7 +4088,7 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar)
formats = gdk_content_formats_builder_free_to_formats (builder);
dest = gtk_drop_target_new (formats, GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
gdk_content_formats_unref (formats);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (drag_motion_callback), sidebar);
+ g_signal_connect (dest, "accept", G_CALLBACK (drag_motion_callback), sidebar);
g_signal_connect (dest, "drag-drop", G_CALLBACK (drag_drop_callback), sidebar);
g_signal_connect (dest, "drag-leave", G_CALLBACK (drag_leave_callback), sidebar);
gtk_widget_add_controller (sidebar->list_box, GTK_EVENT_CONTROLLER (dest));
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index d1391626d6..a5f3bbaeb1 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -121,7 +121,7 @@ gtk_stack_switcher_init (GtkStackSwitcher *switcher)
dest = gtk_drop_target_new (formats, 0);
gdk_content_formats_unref (formats);
g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_stack_switcher_drag_leave), switcher);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_stack_switcher_drag_motion), switcher);
+ g_signal_connect (dest, "accept", G_CALLBACK (gtk_stack_switcher_drag_motion), switcher);
gtk_widget_add_controller (GTK_WIDGET (switcher), GTK_EVENT_CONTROLLER (dest));
}
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 055beb76e9..0c775301ec 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -1732,7 +1732,7 @@ gtk_text_init (GtkText *self)
formats = gdk_content_formats_new_for_gtype (G_TYPE_STRING);
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY | GDK_ACTION_MOVE);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_text_drag_motion), self);
+ g_signal_connect (dest, "accept", G_CALLBACK (gtk_text_drag_motion), self);
g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_text_drag_leave), self);
g_signal_connect (dest, "drag-drop", G_CALLBACK (gtk_text_drag_drop), self);
gdk_content_formats_unref (formats);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index ed5f6ad90d..21d0635a05 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -1638,7 +1638,7 @@ gtk_text_view_init (GtkTextView *text_view)
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY | GDK_ACTION_MOVE);
gdk_content_formats_unref (formats);
g_signal_connect (dest, "drag-leave", G_CALLBACK (gtk_text_view_drag_leave), text_view);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (gtk_text_view_drag_motion), text_view);
+ g_signal_connect (dest, "accept", G_CALLBACK (gtk_text_view_drag_motion), text_view);
g_signal_connect (dest, "drag-drop", G_CALLBACK (gtk_text_view_drag_drop), text_view);
gtk_widget_add_controller (GTK_WIDGET (text_view), GTK_EVENT_CONTROLLER (dest));
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index d53ed0f2fe..6dc7fa4004 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -12924,7 +12924,7 @@ gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
di->dest = gtk_drop_target_new (formats, actions);
g_signal_connect (di->dest, "drag-leave", G_CALLBACK (gtk_tree_view_drag_leave), tree_view);
- g_signal_connect (di->dest, "drag-motion", G_CALLBACK (gtk_tree_view_drag_motion), tree_view);
+ g_signal_connect (di->dest, "accept", G_CALLBACK (gtk_tree_view_drag_motion), tree_view);
g_signal_connect (di->dest, "drag-drop", G_CALLBACK (gtk_tree_view_drag_drop), tree_view);
gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (di->dest));
g_object_ref (di->dest);
diff --git a/tests/testdnd.c b/tests/testdnd.c
index d267c70866..1c89fccbc5 100644
--- a/tests/testdnd.c
+++ b/tests/testdnd.c
@@ -503,7 +503,7 @@ popup_cb (gpointer data)
gtk_grid_attach (GTK_GRID (grid), button, i, j, 1, 1);
dest = gtk_drop_target_new (targets, GDK_ACTION_COPY | GDK_ACTION_MOVE);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (popup_motion), NULL);
+ g_signal_connect (dest, "accept", G_CALLBACK (popup_motion), NULL);
g_signal_connect (dest, "drag-leave", G_CALLBACK (popup_leave), NULL);
gtk_widget_add_controller (button, GTK_EVENT_CONTROLLER (dest));
}
@@ -607,7 +607,7 @@ main (int argc, char **argv)
label = gtk_label_new ("Popup\n");
dest = gtk_drop_target_new (targets, GDK_ACTION_COPY | GDK_ACTION_MOVE);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (popsite_motion), NULL);
+ g_signal_connect (dest, "accept", G_CALLBACK (popsite_motion), NULL);
g_signal_connect (dest, "drag-leave", G_CALLBACK (popsite_leave), NULL);
gtk_widget_add_controller (label, GTK_EVENT_CONTROLLER (dest));
@@ -621,7 +621,7 @@ main (int argc, char **argv)
targets = gdk_content_formats_new (NULL, 0);
dest = gtk_drop_target_new (targets, 0);
g_signal_connect (dest, "drag-leave", G_CALLBACK (target_drag_leave), pixmap);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (target_drag_motion), pixmap);
+ g_signal_connect (dest, "accept", G_CALLBACK (target_drag_motion), pixmap);
g_signal_connect (dest, "drag-drop", G_CALLBACK (target_drag_drop), pixmap);
gtk_widget_add_controller (pixmap, GTK_EVENT_CONTROLLER (dest));
gdk_content_formats_unref (targets);
diff --git a/tests/testdnd2.c b/tests/testdnd2.c
index b601ad6bcb..09cefbfae9 100644
--- a/tests/testdnd2.c
+++ b/tests/testdnd2.c
@@ -160,6 +160,39 @@ ask_actions (GdkDrop *drop,
gtk_popover_popup (GTK_POPOVER (popover));
}
+static gboolean
+delayed_deny (gpointer data)
+{
+ GtkDropTarget *dest = data;
+ GtkWidget *image = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
+ GdkDrop *drop = GDK_DROP (g_object_get_data (G_OBJECT (image), "drop"));
+
+ if (drop)
+ {
+ g_print ("denying drop, late\n");
+ gtk_drop_target_deny_drop (dest, drop);
+ }
+
+ return G_SOURCE_REMOVE;
+}
+
+static gboolean
+image_drag_motion (GtkDropTarget *dest,
+ GdkDrop *drop,
+ int x,
+ int y,
+ gpointer data)
+{
+ GtkWidget *image = data;
+ g_object_set_data_full (G_OBJECT (image), "drop", g_object_ref (drop), g_object_unref);
+
+ g_timeout_add (1000, delayed_deny, dest);
+
+ gdk_drop_status (drop, gtk_drop_target_get_actions (dest));
+
+ return TRUE;
+}
+
static gboolean
image_drag_drop (GtkDropTarget *dest,
GdkDrop *drop,
@@ -312,6 +345,7 @@ make_image (const gchar *icon_name, int hotspot)
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY|GDK_ACTION_MOVE|GDK_ACTION_ASK);
+ g_signal_connect (dest, "accept", G_CALLBACK (image_drag_motion), image);
g_signal_connect (dest, "drag-drop", G_CALLBACK (image_drag_drop), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
diff --git a/tests/testdnd3.c b/tests/testdnd3.c
index a2c5c8115b..5f2bb0e92b 100644
--- a/tests/testdnd3.c
+++ b/tests/testdnd3.c
@@ -306,7 +306,7 @@ canvas_item_new (int i,
formats = gdk_content_formats_new_for_gtype (GDK_TYPE_RGBA);
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
g_signal_connect (dest, "drag-drop", G_CALLBACK (item_drag_drop), NULL);
- g_signal_connect (dest, "drag-motion", G_CALLBACK (item_drag_motion), NULL);
+ g_signal_connect (dest, "accept", G_CALLBACK (item_drag_motion), NULL);
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (dest));
gdk_content_formats_unref (formats);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]