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 639584 - initial emission of GtkWidget:style-set is not happening
initial emission of GtkWidget:style-set is not happening
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
3.0.x
Other Linux
: Normal critical
: ---
Assigned To: Carlos Garnacho
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-01-15 06:45 UTC by sangu
Modified: 2011-04-07 05:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sangu 2011-01-15 06:45:34 UTC
Version : 2.33.2-2.fc15 
See Also https://bugzilla.redhat.com/show_bug.cgi?id=669859


$ gdb gucharmap 
(gdb) r
Starting program: /usr/bin/gucharmap 
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffeb65e700 (LWP 29490)]
**
ERROR:gucharmap-chartable.c:851:get_font_size_px: assertion failed: (priv->font_desc != NULL)

Program received signal SIGABRT, Aborted.
0x00007ffff403c1b5 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install atk-1.32.0-2.fc15.x86_64 cairo-1.10.2-1.fc15.x86_64 cairo-gobject-1.10.2-1.fc15.x86_64 expat-2.0.1-10.fc13.x86_64 fontconfig-2.8.0-2.fc14.x86_64 freetype-2.4.4-1.fc15.x86_64 gdk-pixbuf2-2.23.0-1.fc15.x86_64 glibc-2.12.90-21.fc15.x86_64 gtk-theme-engine-clearlooks-2.91.5-1.fc15.x86_64 libX11-1.4.0-1.fc15.x86_64 libXau-1.0.6-1.fc14.x86_64 libXcomposite-0.4.3-1.fc15.x86_64 libXcursor-1.1.11-1.fc15.x86_64 libXdamage-1.1.3-1.fc14.x86_64 libXext-1.2.0-1.fc15.x86_64 libXfixes-4.0.5-1.fc14.x86_64 libXi-1.4.0-1.fc15.x86_64 libXinerama-1.1.1-1.fc15.x86_64 libXrandr-1.3.1-1.fc15.x86_64 libXrender-0.9.6-1.fc14.x86_64 libgcc-4.5.1-6.fc15.x86_64 libpng-1.2.44-1.fc14.x86_64 libselinux-2.0.98-1.fc15.x86_64 libxcb-1.7-1.fc15.x86_64 pango-1.28.3-1.fc15.x86_64 pixman-0.20.0-1.fc15.x86_64 zlib-1.2.5-2.fc14.x86_64
(gdb) bt
  • #0 raise
    from /lib64/libc.so.6
  • #1 abort
    from /lib64/libc.so.6
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 1369
  • #4 get_font_size_px
    at gucharmap-chartable.c line 851
  • #5 gucharmap_chartable_get_preferred_width
    at gucharmap-chartable.c line 1796
  • #6 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #7 gtk_scrolled_window_get_preferred_size
  • #8 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #9 gtk_widget_get_preferred_size
    at gtksizerequest.c line 532
  • #10 gtk_notebook_size_request
    at gtknotebook.c line 1976
  • #11 gtk_notebook_get_preferred_width
    at gtknotebook.c line 2260
  • #12 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #13 gtk_paned_get_preferred_size
    at gtkpaned.c line 879
  • #14 compute_size_for_orientation
  • #15 gtk_box_get_size
    at gtkbox.c line 903
  • #16 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #17 gtk_window_get_preferred_width
    at gtkwindow.c line 6172
  • #18 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #19 gtk_widget_get_preferred_size
    at gtksizerequest.c line 532
  • #20 gtk_window_compute_hints
    at gtkwindow.c line 7193
  • #21 gtk_window_compute_configure_request
    at gtkwindow.c line 6514
  • #22 gtk_window_show
    at gtkwindow.c line 4613
  • #23 g_closure_invoke
    at gclosure.c line 767
  • #24 signal_emit_unlocked_R
    at gsignal.c line 3182
  • #25 g_signal_emit_valist
    at gsignal.c line 2983
  • #26 g_signal_emit
    at gsignal.c line 3040
  • #27 gtk_widget_show
    at gtkwidget.c line 3895
  • #28 main
    at main.c line 104

Comment 1 Christian Persch 2011-01-18 14:02:56 UTC
Not reproducible here using gucharmap and gtk+ from master.
Comment 2 Luca Ferretti 2011-02-23 21:44:00 UTC
Christian, I'm experiencing it in jhbuild sandbox. Something similar happened to me some time ago with gnome-terminal, when a font related gsettings key was not setted up properly, but now gnome-terminal works fine :/

Here is my stacktrace:


ERROR:gucharmap-chartable.c:851:get_font_size_px: assertion failed: (priv->font_desc != NULL)

Program received signal SIGABRT, Aborted.
0x00007ffff430eba5 in raise () from /lib/libc.so.6
(gdb) 
(gdb) t a a bt

Thread 1 (Thread 0x7ffff7fc2920 (LWP 8639))

  • #0 raise
    from /lib/libc.so.6
  • #1 abort
    from /lib/libc.so.6
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 1369
  • #4 get_font_size_px
    at gucharmap-chartable.c line 851
  • #5 gucharmap_chartable_get_preferred_width
    at gucharmap-chartable.c line 1796
  • #6 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #7 gtk_scrolled_window_get_preferred_size
    at gtkscrolledwindow.c line 2127
  • #8 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #9 gtk_widget_get_preferred_size
    at gtksizerequest.c line 525
  • #10 gtk_notebook_size_request
    at gtknotebook.c line 1974
  • #11 gtk_notebook_get_preferred_width
    at gtknotebook.c line 2258
  • #12 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #13 gtk_paned_get_preferred_size
    at gtkpaned.c line 879
  • #14 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #15 gtk_box_get_size
    at gtkbox.c line 911
  • #16 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #17 gtk_window_get_preferred_width
    at gtkwindow.c line 6079
  • #18 compute_size_for_orientation
    at gtksizerequest.c line 213
  • #19 gtk_widget_get_preferred_size
    at gtksizerequest.c line 525
  • #20 gtk_window_compute_hints
    at gtkwindow.c line 7096
  • #21 gtk_window_compute_configure_request
    at gtkwindow.c line 6418
  • #22 gtk_window_show
    at gtkwindow.c line 4569
  • #23 g_closure_invoke
    at gclosure.c line 767
  • #24 signal_emit_unlocked_R
    at gsignal.c line 3182
  • #25 g_signal_emit_valist
    at gsignal.c line 2983
  • #26 g_signal_emit
    at gsignal.c line 3040
  • #27 gtk_widget_show
    at gtkwidget.c line 3884
  • #28 main
    at main.c line 104

Comment 3 Luca Ferretti 2011-02-23 21:46:52 UTC
not sure, but maybe gnome-terminal was fixed by this commit
http://git.gnome.org/browse/gnome-terminal/commit/?id=e1ba3eea28f62c7b9b16a35b2d625aaf925f4802

And gucharmap should still use gcong
Comment 4 Christian Persch 2011-02-23 22:09:08 UTC
Works here.

The g-t bug is totally unrelated; gucharmap isn't using that gconf key.
Comment 5 sangu 2011-02-24 08:06:44 UTC
"/apps/gucharmap/font" is empty -> gucharmap crashs

See Also : https://bugzilla.redhat.com/show_bug.cgi?id=669859#c6

gucharmap-2.33.2-5.fc15.x86_64
gtk3-3.0.1-1.fc15.x86_64
glib2-2.28.1-1.fc15.x86_64
Comment 6 Christian Persch 2011-03-20 20:06:02 UTC
This is a gtk bug.

On gtk2, the style-set signal was emitted for the GucharmapChartable widget before the first size negotiation, but on gtk3, there is no emission of style-set (nor style-updated) before the first size negotiation happens.
Comment 7 Benjamin Otte (Company) 2011-03-26 20:26:14 UTC
Ok, Carlos committed b7f772eb93e8615ebf14f5bdde33bc59dd0b11bf trying to fix this and I'm sure it somehow magically solves this current issue, but 
(1) the patch is completely bogus
What the commit message says is in no way related to what the patch does and the patch changes quite a few things.
(2) I'm not sure style-updated should be emitted "initially".
As opposed to GtkStyle, the widget's style context is always valid, so you can apply all the features immediately instead of having to wait for a valid style from realized().

That said, we should still make sure to emit STYLE_SET once upon realize to keep backwards compat with GTK2.
Comment 8 Benjamin Otte (Company) 2011-03-26 23:56:53 UTC
commit fafee4e27645f2b9f819444ad8ce6fe1f67182b8
Author: Benjamin Otte <otte@redhat.com>
Date:   Sat Mar 26 23:34:45 2011 +0100

    widget: Emit initial style-set signal in the same situations as GTK2
    
    This ensures that widgets that aren't ported and rely on the style-set
    signal being emitted work as well as before. They should not rely on
    style-set being emitted however.
    
    Note that this function is a no-op if the initial style has been set
    already and is very cheap if it has not been set yet. It only becomes
    relevant if the resulting style actually gets used.