After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641429 - Errors creating a GtkWidget without a display
Errors creating a GtkWidget without a display
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
2.99.x
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-02-04 02:10 UTC by Bastien Nocera
Modified: 2011-02-08 02:23 UTC
See Also:
GNOME target: 3.0
GNOME version: ---



Description Bastien Nocera 2011-02-04 02:10:32 UTC
Gtk-CRITICAL **: gtk_style_context_set_screen: assertion `GDK_IS_SCREEN (screen)' failed


  • #0 g_logv
    at gmessages.c line 563
  • #1 g_log
    at gmessages.c line 577
  • #2 _gtk_style_new_for_path
    at gtkstyle.c line 822
  • #3 gtk_style_new
    at gtkstyle.c line 851
  • #4 gtk_widget_get_default_style
    at gtkwidget.c line 8765
  • #5 gtk_widget_init
    at gtkwidget.c line 3511
  • #6 g_type_create_instance
    at gtype.c line 1881
  • #7 g_object_constructor
    at gobject.c line 1615
  • #8 g_object_newv
    at gobject.c line 1398
  • #9 g_object_new
    at gobject.c line 1308
  • #10 bacon_video_widget_new
    at bacon-video-widget-gst-0.10.c line 6836
  • #11 main
    at totem-video-thumbnailer.c line 846

This used to work in GTK+ 2.x, even if it was a slight abuse of GTK+.
Comment 1 Michael Natterer 2011-02-05 13:16:40 UTC
The fix for this (4dc9b294d8a5bd822828964930b834f4b8999cff) triggers
a gazillion warnings in GIMP which go away if I revert the patch.
Comment 2 Michael Natterer 2011-02-05 13:20:41 UTC
The actual problem seems to be that the fix causes an inconsistent
state where gtk_widget_get_screen() (which many places check) returns
the non-NULL default screen, while gtk_style_context_get_screen() (which
is called by the functions called inside above check) returns a NULL screen.

This happens e.g. if I call gtk_entry_set_icon_from_stock() on
an unrealized widget, which is a completely normal thing to do.
Comment 3 Matthias Clasen 2011-02-06 19:29:27 UTC
I have reverted part of this that cased warnings in gtk-demo. Are you still seeing problems ?