summaryrefslogtreecommitdiff
path: root/gtk/gtkbox.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-05-27 18:52:02 +0200
committerBenjamin Otte <otte@redhat.com>2011-06-02 02:03:51 +0200
commitbc9c43c1cbb1fdb7faf292ee0e57c5efd06e890e (patch)
tree9f3b712c04580a7fd7d9b3720d814bf14618cdf1 /gtk/gtkbox.c
parent79de8e4d08ca9cfbe70f3ac1c4a2adb2902894e5 (diff)
downloadgtk+-bc9c43c1cbb1fdb7faf292ee0e57c5efd06e890e.tar.gz
box: Only emit pack-type notify if the pack type really changed
This is not very useful in itself, but the code reorg will be useful once we do style invalidation.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r--gtk/gtkbox.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 9a205792cd..b1d1df952b 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -1612,11 +1612,13 @@ gtk_box_set_child_packing (GtkBox *box,
gtk_widget_child_notify (child, "fill");
child_info->padding = padding;
gtk_widget_child_notify (child, "padding");
- if (pack_type == GTK_PACK_END)
- child_info->pack = GTK_PACK_END;
- else
- child_info->pack = GTK_PACK_START;
- gtk_widget_child_notify (child, "pack-type");
+ if (pack_type != GTK_PACK_END)
+ pack_type = GTK_PACK_START;
+ if (child_info->pack_type != pack_type)
+ {
+ child_info->pack = GTK_PACK_END;
+ gtk_widget_child_notify (child, "pack-type");
+ }
if (gtk_widget_get_visible (child)
&& gtk_widget_get_visible (GTK_WIDGET (box)))