[gtk+] dnd: Handle rootwin drop in gdk
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] dnd: Handle rootwin drop in gdk
- Date: Sun, 3 Dec 2017 05:42:09 +0000 (UTC)
commit e74c46fc4e4eac7a9fda50d2029bec8e5b7bf187
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Dec 3 06:22:25 2017 +0100
dnd: Handle rootwin drop in gdk
This lets us drop the only use of the drag protocol in gtk.
gtk/gtkdnd.c | 46 ++++++----------------------------------------
1 files changed, 6 insertions(+), 40 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 848ee5f..b1f2564 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -1504,47 +1504,13 @@ static void
gtk_drag_drop (GtkDragSourceInfo *info,
guint32 time)
{
- if (gdk_drag_context_get_protocol (info->context) == GDK_DRAG_PROTO_ROOTWIN)
- {
- GtkSelectionData selection_data;
- GdkAtom found = NULL;
- /* GTK+ traditionally has used application/x-rootwin-drop, but the
- * XDND spec specifies x-rootwindow-drop.
- */
- if (gdk_content_formats_contain_mime_type (info->target_list, "application/x-rootwindow-drop"))
- found = gdk_atom_intern ("application/x-rootwindow-drop", FALSE);
- if (gdk_content_formats_contain_mime_type (info->target_list, "application/x-rootwin-drop"))
- found = gdk_atom_intern ("application/x-rootwin-drop", FALSE);
- else found = NULL;
-
- if (found)
- {
- selection_data.selection = NULL;
- selection_data.target = found;
- selection_data.data = NULL;
- selection_data.length = -1;
-
- g_signal_emit_by_name (info->widget, "drag-data-get",
- info->context, &selection_data,
- time);
+ if (info->icon_window)
+ gtk_widget_hide (info->icon_window);
- /* FIXME: Should we check for length >= 0 here? */
- gtk_drag_drop_finished (info, GTK_DRAG_RESULT_SUCCESS, time);
- return;
- }
-
- gtk_drag_drop_finished (info, GTK_DRAG_RESULT_NO_TARGET, time);
- }
- else
- {
- if (info->icon_window)
- gtk_widget_hide (info->icon_window);
-
- info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
- gtk_drag_abort_timeout,
- info);
- g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
- }
+ info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
+ gtk_drag_abort_timeout,
+ info);
+ g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]