Merge branch 'dnd-fixes' into 'gtk-3-24'
gtkdnd: Fix critical warnings and/or crashes when using GtkSocket/GtkPlug See merge request GNOME/gtk!6660
This commit is contained in:
commit
866adad06b
20
gtk/gtkdnd.c
20
gtk/gtkdnd.c
@ -2666,6 +2666,8 @@ gtk_drag_drop (GtkDragSourceInfo *info,
|
|||||||
{
|
{
|
||||||
if (info->icon_window)
|
if (info->icon_window)
|
||||||
gtk_widget_hide (info->icon_window);
|
gtk_widget_hide (info->icon_window);
|
||||||
|
if (info->proxy_dest)
|
||||||
|
g_object_ref (info->proxy_dest->context);
|
||||||
|
|
||||||
gdk_drag_drop (info->context, time);
|
gdk_drag_drop (info->context, time);
|
||||||
info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
|
info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
|
||||||
@ -2759,7 +2761,7 @@ static void
|
|||||||
gtk_drag_source_info_free (GtkDragSourceInfo *info)
|
gtk_drag_source_info_free (GtkDragSourceInfo *info)
|
||||||
{
|
{
|
||||||
gtk_drag_remove_icon (info);
|
gtk_drag_remove_icon (info);
|
||||||
gtk_widget_destroy (info->icon_window);
|
g_clear_pointer (&info->icon_window, gtk_widget_destroy);
|
||||||
g_free (info);
|
g_free (info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2814,7 +2816,11 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info)
|
|||||||
gtk_target_list_unref (info->target_list);
|
gtk_target_list_unref (info->target_list);
|
||||||
|
|
||||||
if (info->drop_timeout)
|
if (info->drop_timeout)
|
||||||
g_source_remove (info->drop_timeout);
|
{
|
||||||
|
g_source_remove (info->drop_timeout);
|
||||||
|
if (info->proxy_dest)
|
||||||
|
g_object_unref (info->proxy_dest->context);
|
||||||
|
}
|
||||||
|
|
||||||
if (info->update_idle)
|
if (info->update_idle)
|
||||||
g_source_remove (info->update_idle);
|
g_source_remove (info->update_idle);
|
||||||
@ -3260,14 +3266,20 @@ static gboolean
|
|||||||
gtk_drag_abort_timeout (gpointer data)
|
gtk_drag_abort_timeout (gpointer data)
|
||||||
{
|
{
|
||||||
GtkDragSourceInfo *info = data;
|
GtkDragSourceInfo *info = data;
|
||||||
|
GdkDragContext *context = NULL;
|
||||||
guint32 time = GDK_CURRENT_TIME;
|
guint32 time = GDK_CURRENT_TIME;
|
||||||
|
|
||||||
if (info->proxy_dest)
|
if (info->proxy_dest)
|
||||||
time = info->proxy_dest->proxy_drop_time;
|
{
|
||||||
|
time = info->proxy_dest->proxy_drop_time;
|
||||||
|
context = info->proxy_dest->context;
|
||||||
|
}
|
||||||
|
|
||||||
info->drop_timeout = 0;
|
info->drop_timeout = 0;
|
||||||
gtk_drag_drop_finished (info, GTK_DRAG_RESULT_TIMEOUT_EXPIRED, time);
|
gtk_drag_drop_finished (info, GTK_DRAG_RESULT_TIMEOUT_EXPIRED, time);
|
||||||
|
|
||||||
|
g_clear_object (&context);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user