[gtk+] dnd: When setting a dnd icon widget, unset old one



commit fa7816d99c70a759d67ddc09bc2cadf7cf2a29dd
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 19 08:09:06 2015 +0100

    dnd: When setting a dnd icon widget, unset old one
    
    Setting a DND icon twice should actually work and not cause warnings the
    2nd time.

 gtk/gtkdnd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 0907fd9..c4fd666 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -2485,6 +2485,8 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context,
       gtk_widget_show (widget);
     }
 
+  if (gtk_bin_get_child (GTK_BIN (info->icon_window)))
+    gtk_container_remove (GTK_CONTAINER (info->icon_window), gtk_bin_get_child (GTK_BIN 
(info->icon_window)));
   gtk_container_add (GTK_CONTAINER (info->icon_window), widget);
 
 out:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]