Commit f98686da authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Check for the RESIZE_NEEDED flag and remove the widget from the list.

Mon Feb  9 23:08:16 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtkwidget.c (gtk_widget_unparent): Check for
	  the RESIZE_NEEDED flag and remove the widget from the list.
	  Remove the check from gtk_widget_destroy (no longer needed).

	* Unrealize widget _before_ calling "destroy" signal, and
	  unset VISIBLE flag.

	* Unrealize child widgets _after_ unrealizing parent to improve
	  visual appearance.
parent 6246db92
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c (gtk_widget_unparent): Check for
the RESIZE_NEEDED flag and remove the widget from the list.
Remove the check from gtk_widget_destroy (no longer needed).
* Unrealize widget _before_ calling "destroy" signal, and
unset VISIBLE flag.
* Unrealize child widgets _after_ unrealizing parent to improve
visual appearance.
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
......@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
......
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c (gtk_widget_unparent): Check for
the RESIZE_NEEDED flag and remove the widget from the list.
Remove the check from gtk_widget_destroy (no longer needed).
* Unrealize widget _before_ calling "destroy" signal, and
unset VISIBLE flag.
* Unrealize child widgets _after_ unrealizing parent to improve
visual appearance.
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
......@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
......
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c (gtk_widget_unparent): Check for
the RESIZE_NEEDED flag and remove the widget from the list.
Remove the check from gtk_widget_destroy (no longer needed).
* Unrealize widget _before_ calling "destroy" signal, and
unset VISIBLE flag.
* Unrealize child widgets _after_ unrealizing parent to improve
visual appearance.
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
......@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
......
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c (gtk_widget_unparent): Check for
the RESIZE_NEEDED flag and remove the widget from the list.
Remove the check from gtk_widget_destroy (no longer needed).
* Unrealize widget _before_ calling "destroy" signal, and
unset VISIBLE flag.
* Unrealize child widgets _after_ unrealizing parent to improve
visual appearance.
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
......@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
......
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c (gtk_widget_unparent): Check for
the RESIZE_NEEDED flag and remove the widget from the list.
Remove the check from gtk_widget_destroy (no longer needed).
* Unrealize widget _before_ calling "destroy" signal, and
unset VISIBLE flag.
* Unrealize child widgets _after_ unrealizing parent to improve
visual appearance.
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
......@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
......
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c (gtk_widget_unparent): Check for
the RESIZE_NEEDED flag and remove the widget from the list.
Remove the check from gtk_widget_destroy (no longer needed).
* Unrealize widget _before_ calling "destroy" signal, and
unset VISIBLE flag.
* Unrealize child widgets _after_ unrealizing parent to improve
visual appearance.
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
......@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
......
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c (gtk_widget_unparent): Check for
the RESIZE_NEEDED flag and remove the widget from the list.
Remove the check from gtk_widget_destroy (no longer needed).
* Unrealize widget _before_ calling "destroy" signal, and
unset VISIBLE flag.
* Unrealize child widgets _after_ unrealizing parent to improve
visual appearance.
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
......@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
* gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
......
......@@ -1085,6 +1085,13 @@ gtk_widget_unparent (GtkWidget *widget)
if (child == widget)
gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
}
if (GTK_WIDGET_RESIZE_NEEDED (widget))
{
GTK_CONTAINER (toplevel)->resize_widgets =
g_slist_remove (GTK_CONTAINER (toplevel)->resize_widgets, widget);
GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_NEEDED);
}
if (widget->window &&
GTK_WIDGET_NO_WINDOW (widget) &&
......@@ -1117,9 +1124,23 @@ gtk_widget_destroy (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
if (GTK_WIDGET_REALIZED (widget))
gtk_widget_unrealize (widget);
gtk_object_destroy (GTK_OBJECT (widget));
}
/*****************************************
* gtk_widget_destroyed:
* Utility function: sets widget_pointer
* to NULL when widget is destroyed.
*
* arguments:
*
* results:
*****************************************/
void
gtk_widget_destroyed (GtkWidget *widget,
GtkWidget **widget_pointer)
......@@ -3091,22 +3112,11 @@ gtk_widget_real_destroy (GtkObject *object)
GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_PENDING);
}
if (GTK_WIDGET_RESIZE_NEEDED (widget))
{
GtkWidget *toplevel;
toplevel = gtk_widget_get_toplevel (widget);
GTK_CONTAINER (toplevel)->resize_widgets =
g_slist_remove (GTK_CONTAINER (toplevel)->resize_widgets, widget);
GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_NEEDED);
}
if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
gtk_widget_shape_combine_mask (widget, NULL, -1, -1);
gtk_grab_remove (widget);
gtk_selection_remove_all (widget);
gtk_widget_unrealize (widget);
if (widget->parent)
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
......@@ -3316,11 +3326,6 @@ gtk_widget_real_unrealize (GtkWidget *widget)
/* printf ("unrealizing %s\n", gtk_type_name (GTK_OBJECT(widget)->klass->type));
*/
if (GTK_IS_CONTAINER (widget))
gtk_container_foreach (GTK_CONTAINER (widget),
(GtkCallback)gtk_widget_unrealize,
NULL);
gtk_style_detach (widget->style);
if (!GTK_WIDGET_NO_WINDOW (widget))
{
......@@ -3331,6 +3336,14 @@ gtk_widget_real_unrealize (GtkWidget *widget)
{
gdk_window_unref (widget->window);
}
/* Unrealize afterwards to improve visual effect */
if (GTK_IS_CONTAINER (widget))
gtk_container_foreach (GTK_CONTAINER (widget),
(GtkCallback)gtk_widget_unrealize,
NULL);
widget->window = NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment