From 9546a9dc14051aba0c1f63166cf91a709aec0136 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 23 Apr 1998 04:26:20 +0000 Subject: [PATCH] Remember whether the widget was visible before we unparent it. 1998-04-22 Federico Mena Quintero * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was visible before we unparent it. --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkbin.c | 4 +++- 8 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3e2ae54f1a..cbfd4691f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1998-04-22 Federico Mena Quintero + + * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was + visible before we unparent it. + Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 3e2ae54f1a..cbfd4691f2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +1998-04-22 Federico Mena Quintero + + * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was + visible before we unparent it. + Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3e2ae54f1a..cbfd4691f2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +1998-04-22 Federico Mena Quintero + + * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was + visible before we unparent it. + Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 3e2ae54f1a..cbfd4691f2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +1998-04-22 Federico Mena Quintero + + * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was + visible before we unparent it. + Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 3e2ae54f1a..cbfd4691f2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +1998-04-22 Federico Mena Quintero + + * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was + visible before we unparent it. + Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3e2ae54f1a..cbfd4691f2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +1998-04-22 Federico Mena Quintero + + * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was + visible before we unparent it. + Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3e2ae54f1a..cbfd4691f2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +1998-04-22 Federico Mena Quintero + + * gtk/gtkbin.c (gtk_bin_remove): Remember whether the widget was + visible before we unparent it. + Wed Apr 22 04:15:26 1998 Tim Janik * gtk/gtkmain.c (gtk_handle_current_timeouts): prepend the diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 87e37b98c3..4e7b56e140 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -237,10 +237,12 @@ gtk_bin_remove (GtkContainer *container, if (bin->child == widget) { + gboolean widget_was_visible = GTK_WIDGET_VISIBLE (widget); + gtk_widget_unparent (widget); bin->child = NULL; - if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container)) + if (widget_was_visible && GTK_WIDGET_VISIBLE (container)) gtk_widget_queue_resize (GTK_WIDGET (container)); } }