GNOME Bugzilla – Bug 661286
[PATCH] Remove N_GTK_STATES assertion in ui/theme.c
Last modified: 2011-10-08 21:31:07 UTC
Using mutter-3.2.0-1.fc16.x86_64 The assertion at theme.c::1340, i.e. g_assert (spec->data.gtk.state < N_GTK_STATES); is a leftover from when Mutter used GtkStateFlags. Mutter has since been modified to use GtkStateType, but the assertion was not removed, which causes some themes to crash mutter with assertion failed (i.e. Nodoka). The reason is that before, the GTK_STATE_* went from 0 to 4 (and N_GTK_STATES is 5), while now GTK_STATE_FLAG_* have values 0, 1, 2, 4, 8, .. 32. I suggest to remove the assertion completely, since an invalid state specification is already handled at theme.c::1317 anyway. A corresponding patch is attached.
Created attachment 198625 [details] Patch
Can you attach a patch created by the output of git format-patch?
Created attachment 198627 [details] [review] Patch patch from git format-patch
(In reply to comment #0) > Using mutter-3.2.0-1.fc16.x86_64 > > The assertion at theme.c::1340, i.e. > > g_assert (spec->data.gtk.state < N_GTK_STATES); > > is a leftover from when Mutter used GtkStateFlags. Mutter has since been > modified to use GtkStateType, but the assertion was not removed, which causes > some themes to crash mutter with assertion failed (i.e. Nodoka). > The reason is that before, the GTK_STATE_* went from 0 to 4 (and N_GTK_STATES > is 5), while now GTK_STATE_FLAG_* have values 0, 1, 2, 4, 8, .. 32. It seems like mutter still uses GtkStateFlags http://git.gnome.org/browse/mutter/tree/src/ui/theme-private.h#n302 Maybe you have a distro patch?
Darn, I meant that it now uses GtkStateFlags and _used to use_ GtkStateType. Sorry... (but patch is still valid).
Review of attachment 198627 [details] [review]: The patch looks fine to me. Add a proper commit message like: theme: Remove outdated assertion The theme state used to use GtkStateType, but was ported over to GtkStateFlags, leaving behind a broken assertion that fails when [put some examples of when you've hit the assertion]. https://bugzilla.gnome.org/show_bug.cgi?id=661286 and it should be good to go.
Created attachment 198634 [details] [review] Patch v2, detailed commit message
Pushed with a few commit message fixups (79-char limit, remove "See "). Thanks!