diff --git a/docs/reference/gdk/gdk-sections.txt b/docs/reference/gdk/gdk-sections.txt index 5d05c993c8..50617cbaa4 100644 --- a/docs/reference/gdk/gdk-sections.txt +++ b/docs/reference/gdk/gdk-sections.txt @@ -1235,6 +1235,7 @@ gdk_drag_drop gdk_drag_find_window gdk_drag_find_window_for_screen gdk_drag_context_ref +gdk_drag_context_get_source_window gdk_drag_begin gdk_drag_motion gdk_drop_finish diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index f1d933289c..b900b5f226 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -539,6 +539,7 @@ gdk_drag_context_get_actions gdk_drag_context_get_selected_action gdk_drag_context_get_suggested_action gdk_drag_context_list_targets +gdk_drag_context_get_source_window gdk_drag_find_window gdk_drag_get_protocol #endif diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index 2e32da8419..2043094959 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -150,5 +150,23 @@ gdk_drag_context_get_selected_action (GdkDragContext *context) return context->action; } +/** + * gdk_drag_context_get_source_window: + * @context: a #GdkDragContext + * + * Returns the #GdkWindow where the DND operation started. + * + * Return value: (transfer none): a #GdkWindow + * + * Since: 2.22 + **/ +GdkWindow * +gdk_drag_context_get_source_window (GdkDragContext *context) +{ + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); + + return context->source_window; +} + #define __GDK_DND_C__ #include "gdkaliasdef.c" diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h index 7d7da4397e..9d65d79f0b 100644 --- a/gdk/gdkdnd.h +++ b/gdk/gdkdnd.h @@ -111,6 +111,8 @@ GdkDragAction gdk_drag_context_get_actions (GdkDragContext *context) GdkDragAction gdk_drag_context_get_suggested_action (GdkDragContext *context); GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context); +GdkWindow *gdk_drag_context_get_source_window (GdkDragContext *context); + #ifndef GDK_DISABLE_DEPRECATED void gdk_drag_context_ref (GdkDragContext *context); void gdk_drag_context_unref (GdkDragContext *context);