diff options
author | Owen Taylor <otaylor@redhat.com> | 1998-12-09 06:36:57 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-12-09 06:36:57 +0000 |
commit | 207757e70d8b2d9aa8335d968fd7ac79796264ab (patch) | |
tree | ae572a9674c8dc7b8a0ae7200e6d4e7c5c7632e8 /gtk/gtkwidget.c | |
parent | af84227184f9cbe2c87f0aa09d5c93564150bb70 (diff) | |
download | gtk+-207757e70d8b2d9aa8335d968fd7ac79796264ab.tar.gz |
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r-- | gtk/gtkwidget.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index ac9786fd92..9a400079d2 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -4259,14 +4259,25 @@ gtk_widget_real_unrealize (GtkWidget *widget) g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_WIDGET (widget)); - if (GTK_WIDGET_NO_WINDOW (widget) && GTK_WIDGET_MAPPED (widget)) + if (GTK_WIDGET_MAPPED (widget)) gtk_widget_real_unmap (widget); - GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED | GTK_MAPPED); + GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED); /* printf ("unrealizing %s\n", gtk_type_name (GTK_OBJECT(widget)->klass->type)); */ + /* We must do unrealize child widget BEFORE container widget. + * gdk_window_destroy() destroys specified xwindow and it's sub-xwindows. + * So, unrealizing container widget bofore it's children causes the problem + * (for example, gdk_ic_destroy () with destroyed window causes crash. ) + */ + + 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)) { @@ -4280,12 +4291,7 @@ gtk_widget_real_unrealize (GtkWidget *widget) widget->window = NULL; } - /* Unrealize afterwards to improve visual effect */ - - if (GTK_IS_CONTAINER (widget)) - gtk_container_forall (GTK_CONTAINER (widget), - (GtkCallback) gtk_widget_unrealize, - NULL); + GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED); } /***************************************** |