[gtk/dnd-gestures: 7/30] dnd: Patch up gtk_drag_get_source_widget
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/dnd-gestures: 7/30] dnd: Patch up gtk_drag_get_source_widget
- Date: Wed, 1 Jan 2020 17:56:20 +0000 (UTC)
commit 76830e41e94e1f2f85c1f3b4f543a85d5a7d6f28
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Dec 31 17:01:09 2019 -0500
dnd: Patch up gtk_drag_get_source_widget
This is temporary until gtk_drag_dest_set users
have been ported over.
gtk/gtkdnd.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 17dbb49876..09c6863fe0 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -319,14 +319,19 @@ GtkWidget *
gtk_drag_get_source_widget (GdkDrag *drag)
{
GtkDragSourceInfo *info;
+ GtkDragSource *source;
g_return_val_if_fail (GDK_IS_DRAG (drag), NULL);
info = gtk_drag_get_source_info (drag, FALSE);
- if (info == NULL)
- return NULL;
+ if (info)
+ return info->widget;
+
+ source = gtk_drag_get_source (drag);
+ if (source)
+ return gtk_drag_source_get_origin (source);
- return info->widget;
+ return NULL;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]