summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-01-05 23:45:21 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-01-05 23:45:21 +0000
commit1fd7a6e491b6b76f9281bb14e6161a75df71bf5e (patch)
treea58f1fc1d43aade9e3268238c6caab970f94f12a /gtk/gtkdnd.c
parentce87813af668f77f19509b0b69d6ee9b529cc231 (diff)
downloadgtk+-1fd7a6e491b6b76f9281bb14e6161a75df71bf5e.tar.gz
Make gtk_propagate_event() non-static, we need it in gtkdnd.c so that the
Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c (gtk_propagate_event): Make gtk_propagate_event() non-static, we need it in gtkdnd.c so that the button-release we synthesize gets propagated correctly. * gtk/gtkdnd.c: Use gtk_propagate_event() so release gets to a GtkList. But we can't really get this right without access to the windows event masks and doing X-style propagation ourselves. Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Free memory allocated for target lists. * gtk/gtkdnd.c (gtk_drag_drop_finished): Release selections before destroying info structure. * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add new value GDK_DRAG_PROTO_NONE, use it for non-drag targets, to quiet Purify. * gdk/gdkdnd.c (gdk_window_register_dnd): Set size of property properly.
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r--gtk/gtkdnd.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 4f74cfef88..cb7df4d695 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -2005,11 +2005,14 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
gboolean success,
guint time)
{
+ gtk_drag_source_release_selections (info, time);
+
if (info->proxy_dest)
{
/* The time from the event isn't reliable for Xdnd drags */
gtk_drag_finish (info->proxy_dest->context, success, FALSE,
info->proxy_dest->proxy_drop_time);
+ gtk_drag_source_info_destroy (info);
}
else
{
@@ -2039,8 +2042,6 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
gtk_timeout_add (ANIM_STEP_TIME, gtk_drag_anim_timeout, anim);
}
}
-
- gtk_drag_source_release_selections (info, GDK_CURRENT_TIME); /* fixme */
}
static void
@@ -2459,19 +2460,31 @@ gtk_drag_button_release_cb (GtkWidget *widget,
gtk_grab_remove (widget);
+ /* Send on a release pair to the the original
+ * widget to convince it to release its grab. We need to
+ * call gtk_propagate_event() here, instead of
+ * gtk_widget_event() because widget like GtkList may
+ * expect propagation.
+ */
+
send_event.button.type = GDK_BUTTON_RELEASE;
send_event.button.window = source_widget->window;
+ send_event.button.send_event = TRUE;
+ send_event.button.time = event->time;
send_event.button.x = 0;
send_event.button.y = 0;
+ send_event.button.pressure = 0.;
+ send_event.button.xtilt = 0.;
+ send_event.button.ytilt = 0.;
send_event.button.state = event->state;
send_event.button.button = event->button;
-
- send_event.button.time = event->time;
+ send_event.button.source = GDK_SOURCE_PEN;
+ send_event.button.deviceid = GDK_CORE_POINTER;
+ send_event.button.x_root = 0;
+ send_event.button.y_root = 0;
+
+ gtk_propagate_event (source_widget, &send_event);
- /* Send on the button release to the original widget to
- * convince it to release its grab
- */
- gtk_widget_event (source_widget, &send_event);
gtk_widget_unref (source_widget);
return TRUE;