summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-08-06 17:03:52 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-08-06 17:03:52 +0000
commit39469f8f4abcf4b424186045baa80f067c312064 (patch)
tree9dac5ea10bf7967c78bb0a8cc60b3ea6e881f87d /gtk/gtkdnd.c
parentb65449a7e8e400e4ce674629cdacbfa6e3abb0f4 (diff)
downloadgtk+-39469f8f4abcf4b424186045baa80f067c312064.tar.gz
Really fix the initialization of the target list.
2004-08-06 Matthias Clasen <mclasen@redhat.com> * gtk/gtkdnd.c (gtk_drag_dest_set, gtk_drag_source_set): Really fix the initialization of the target list. Support XDND v5. (#10220, Owen Taylor) * gdk/x11/gdkdnd-x11.c: Record the XDND version and whether the drop was successful in the GdkDragContextPrivateX11 struct. (xdnd_finished_filter): Store the success status of the drop for an XDND version 5 interaction. For other versions, always assume the drop was successful. (xdnd_check_dest): Return the protocol version. (_gdk_drag_get_protocol_for_display): Return the protocol version. (gdk_drag_find_window_for_screen): Store the used protocol version in the GdkDragContext. (xdnd_send_enter): Send the used protocol version from the context, instead of hardwiring 3. (xdnd_enter_filter): Accept protocol versions >= 3 and store the used protocol version in the context. * gdk/gdkdnd.h: * gdk/x11/gdkdnd-x11.c (gdk_drag_drop_succeeded): New function to find out whether a drop was successful.
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r--gtk/gtkdnd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index a8a139e702..92075e6326 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -901,7 +901,10 @@ gtk_drag_dest_set (GtkWidget *widget,
site->flags = flags;
site->have_drag = FALSE;
- site->target_list = NULL;
+ if (targets)
+ site->target_list = gtk_target_list_new (targets, n_targets);
+ else
+ site->target_list = NULL;
site->actions = actions;
site->do_proxy = FALSE;
site->proxy_window = NULL;
@@ -2092,7 +2095,10 @@ gtk_drag_source_set (GtkWidget *widget,
site->start_button_mask = start_button_mask;
- site->target_list = gtk_target_list_new (targets, n_targets);
+ if (targets)
+ site->target_list = gtk_target_list_new (targets, n_targets);
+ else
+ site->target_list = NULL;
site->actions = actions;
}