[gtk/matthiasc/surface-state-rework: 26/80] gtk/dragicon: Don't show until child is set
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/surface-state-rework: 26/80] gtk/dragicon: Don't show until child is set
- Date: Sat, 5 Dec 2020 17:42:38 +0000 (UTC)
commit 1bbc9d72e9392a6f6a29a9a7a59c48067505c8fd
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Nov 25 15:02:26 2020 +0100
gtk/dragicon: Don't show until child is set
Showing before the child would result in bogus
gdk_drag_surface_present() with an "empty" (1x1) size. This can easily
be avoided by postponing showing until there is anything to show.
gtk/gtkdragicon.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkdragicon.c b/gtk/gtkdragicon.c
index 2348674951..e239090011 100644
--- a/gtk/gtkdragicon.c
+++ b/gtk/gtkdragicon.c
@@ -414,7 +414,8 @@ gtk_drag_icon_get_for_drag (GdkDrag *drag)
g_object_set_qdata_full (G_OBJECT (drag), drag_icon_quark, g_object_ref_sink (self), g_object_unref);
- gtk_widget_show (self);
+ if (GTK_DRAG_ICON (self)->child != NULL)
+ gtk_widget_show (self);
}
return self;
@@ -472,7 +473,10 @@ gtk_drag_icon_set_child (GtkDragIcon *self,
self->child = child;
if (self->child)
- gtk_widget_set_parent (self->child, GTK_WIDGET (self));
+ {
+ gtk_widget_set_parent (self->child, GTK_WIDGET (self));
+ gtk_widget_show (GTK_WIDGET (self));
+ }
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CHILD]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]