GNOME Bugzilla – Bug 627764
mismanaged GtkStyle lifecycle
Last modified: 2011-05-04 11:57:10 UTC
this report has been filed here: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/622973 "crashed after disabling the desktop effects, meaning launching metacity --replace" ". Hilo 4 (Thread 11325):
+ Trace 223370
Which g-t and vte version is this, exactly? Are there any messages on console (or in ~/.xsession-errors) from gnome-terminal ? And which theme ?
Oh, and was that with metacity launching with compositing enabled, or disabled? (gconf key /apps/metacity/general/compositing_manager)
libvte is 1:0.25.90-0ubuntu3 gnome-terminal : 2.31.90-0ubuntu1 the messages on the ~/.xsession-errors file: gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_detach: assertion `style->attach_count > 0' failed (gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed (gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_attach: assertion `GTK_IS_STYLE (style)' failed (gnome-terminal:12444): Gtk-CRITICAL **: IA__gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed the theme i'm currently using is clearlooks. And it was launched with the compositing disabled. Thank you for the quick reply!.
Hmm, that shouldn't happen, ever. Possibly a theme bug, or gtk.
One more thing: which gtk modules are loaded? (from gconf key/apps/gnome_settings_daemon/gtk-modules, and various env vars) E.g. & esp. the ubuntu dbusmenu (or whatever it's called) thingy?
just the accessibility is loaded (gail:atk-bridge). Thanks again Christian.
This code from commit ac1e78c78e6a39834d35c525be01d50c348d33ba from bug 612484 looks highly suspicious: /* Remove the GDK window. */ - if (widget->window != NULL) { + if (window != NULL) { /* detach style */ - gtk_style_detach(widget->style); + GtkStyle *style; - gdk_window_set_user_data(widget->window, NULL); - gdk_window_destroy(widget->window); - widget->window = NULL; + style = gtk_widget_get_style (widget); + gtk_style_detach (style); + + gdk_window_set_user_data (window, NULL); + gtk_widget_set_window (widget, NULL); + + gdk_window_destroy (window); } [...] - widget->style = gtk_style_attach(widget->style, widget->window); + style = gtk_widget_get_style (widget); + style = gtk_style_attach (style, window); + gtk_widget_set_style (widget, style); Is this code really completely equivalent to the previous code? AFAICT gtk_widget_set_style does more than just setting widget->style. This part should use gtk_widget_style_attach() instead.
(In reply to comment #7) > This code from commit ac1e78c78e6a39834d35c525be01d50c348d33ba from bug 612484 > looks highly suspicious: > > /* Remove the GDK window. */ > - if (widget->window != NULL) { > + if (window != NULL) { > /* detach style */ > - gtk_style_detach(widget->style); > + GtkStyle *style; > > - gdk_window_set_user_data(widget->window, NULL); > - gdk_window_destroy(widget->window); > - widget->window = NULL; > + style = gtk_widget_get_style (widget); > + gtk_style_detach (style); > + > + gdk_window_set_user_data (window, NULL); > + gtk_widget_set_window (widget, NULL); > + > + gdk_window_destroy (window); > } > [...] This part looks fine, though a gtk_widget_style_detach() helper function would be a nice addition to gtk+ for symmetry with gtk_widget_style_attach(). > - widget->style = gtk_style_attach(widget->style, widget->window); > + style = gtk_widget_get_style (widget); > + style = gtk_style_attach (style, window); > + gtk_widget_set_style (widget, style); > > Is this code really completely equivalent to the previous code? AFAICT > gtk_widget_set_style does more than just setting widget->style. This part > should use gtk_widget_style_attach() instead. Yeah, it looks like gtk_widget_set_style() is the wrong function to use here, while gtk_widget_style_attach() does exactly what the old code did. Try this patch? diff --git a/src/vte.c b/src/vte.c index abf7473..2464880 100644 --- a/src/vte.c +++ b/src/vte.c @@ -8776,9 +8776,7 @@ vte_terminal_realize(GtkWidget *widget) } #endif /* GTK >= 2.15.1 */ - style = gtk_widget_get_style (widget); - style = gtk_style_attach (style, window); - gtk_widget_set_style (widget, style); + gtk_widget_style_attach (widget); vte_terminal_ensure_font (terminal);
I committed that fix. Let's see if that fixes this problem...
*** Bug 628796 has been marked as a duplicate of this bug. ***
No dups in a long time; let's assume this fixed it.