Commit 1865011b authored by Michael Natterer's avatar Michael Natterer 😴

gtk: don't send BUTTON_RELEASE to unrealized widgets

which happened when the source widget was hidden or destroyed while a
drag was going on, like when dragging from a popup that got a grab
broken as result of the dnd operation.
parent bba7a98c
......@@ -4046,7 +4046,6 @@ gtk_drag_update (GtkDragSourceInfo *info,
static void
gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
{
GdkEvent *send_event;
GtkWidget *source_widget = info->widget;
GdkDevice *pointer, *keyboard;
......@@ -4091,11 +4090,14 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
ungrab_dnd_keys (info->ipc_widget, keyboard, time);
gtk_device_grab_remove (info->ipc_widget, pointer);
/* Send on a release pair to 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.
if (gtk_widget_get_realized (source_widget))
{
GdkEvent *send_event;
/* Send on a release pair to 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 = gdk_event_new (GDK_BUTTON_RELEASE);
......@@ -4113,6 +4115,7 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
gtk_propagate_event (source_widget, send_event);
gdk_event_free (send_event);
}
}
/*************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment