diff options
-rw-r--r-- | gdk/gdkdnd.c | 4 | ||||
-rw-r--r-- | gdk/x11/gdkdnd-x11.c | 4 | ||||
-rw-r--r-- | gtk/gtkdnd.c | 29 | ||||
-rw-r--r-- | gtk/gtkmain.c | 4 | ||||
-rw-r--r-- | gtk/gtkmain.h | 5 |
5 files changed, 31 insertions, 15 deletions
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index 3cd5effbf..728bdb7f5 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -2541,6 +2541,7 @@ gdk_drag_get_protocol (guint32 xid, } } + *protocol = GDK_DRAG_PROTO_NONE; return GDK_NONE; } @@ -2950,8 +2951,7 @@ gdk_window_register_dnd (GdkWindow *window) GDK_WINDOW_XWINDOW (window), xdnd_aware_atom, XA_ATOM, 32, PropModeReplace, - (guchar *)&xdnd_version, - sizeof (xdnd_version)); + (guchar *)&xdnd_version, 1); } /************************************************************* diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 3cd5effbf..728bdb7f5 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -2541,6 +2541,7 @@ gdk_drag_get_protocol (guint32 xid, } } + *protocol = GDK_DRAG_PROTO_NONE; return GDK_NONE; } @@ -2950,8 +2951,7 @@ gdk_window_register_dnd (GdkWindow *window) GDK_WINDOW_XWINDOW (window), xdnd_aware_atom, XA_ATOM, 32, PropModeReplace, - (guchar *)&xdnd_version, - sizeof (xdnd_version)); + (guchar *)&xdnd_version, 1); } /************************************************************* diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 4f74cfef8..cb7df4d69 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; diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 468e18364..841ae1e97 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -85,8 +85,6 @@ static gint gtk_quit_invoke_function (GtkQuitFunction *quitf); static void gtk_quit_destroy (GtkQuitFunction *quitf); static gint gtk_invoke_key_snoopers (GtkWidget *grab_widget, GdkEvent *event); -static void gtk_propagate_event (GtkWidget *widget, - GdkEvent *event); static void gtk_destroy_closure (gpointer data); static gboolean gtk_invoke_idle_timeout (gpointer data); @@ -1196,7 +1194,7 @@ gtk_quit_invoke_function (GtkQuitFunction *quitf) } } -static void +void gtk_propagate_event (GtkWidget *widget, GdkEvent *event) { diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h index 2c7e4eab4..b44489f89 100644 --- a/gtk/gtkmain.h +++ b/gtk/gtkmain.h @@ -139,6 +139,11 @@ GdkEvent* gtk_get_current_event (void); GtkWidget* gtk_get_event_widget (GdkEvent *event); +/* Private routines internal to GTK+ + */ +void gtk_propagate_event (GtkWidget *widget, + GdkEvent *event); + #ifdef __cplusplus } #endif /* __cplusplus */ |