GNOME Bugzilla – Bug 692994
Extensions with stylesheets crash the shell on screen unlock
Last modified: 2013-02-01 16:30:21 UTC
This is a regression from commit dc2ec0a8f95baa (caching of StThemeNodes): - extension is enabled => stylesheet is loaded, properties are cached in theme node - extension is disabled on lock => stylesheet is unloaded, but theme nodes are kept in cache (with cached properties now pointing to invalid memory) - extension is reenabled on unlock => stylesheet is loaded again, but cached theme nodes are reused => crash when accessing invalid memory
Created attachment 234960 [details] [review] st-theme: Add "custom-stylesheets-changed" signal StThemeNodes cache matched properties from stylesheets, so when the list of custom stylesheets changes, the node may miss better matches (when a stylesheet was added) or have pointers to invalid memory in the list (when a stylesheet was removed). In order to allow theme nodes to listen for stylesheet changes, add an appropriate signal to StTheme.
Created attachment 234961 [details] [review] st-theme-node: Recalculate properties on stylesheet changes As theme nodes keep a cache of matched properties, we need to make sure to update it when the list of stylesheets changes. In particular this fixes a regression from commit dc2ec0a8f95baa, which caused extensions with stylesheets to crash the shell when re-enabled (for instances when coming back from the lock screen).
Review of attachment 234960 [details] [review]: Ok
Review of attachment 234961 [details] [review]: Looks good
Review of attachment 234961 [details] [review]: ::: src/st/st-theme-node.c @@ +64,3 @@ +static void +on_custom_stylesheets_changed (StTheme *theme, + gpointer data) Oh, forgot to ask you to fix this indentation, please do.
Attachment 234960 [details] pushed as 2cf403a - st-theme: Add "custom-stylesheets-changed" signal Attachment 234961 [details] pushed as 655dce6 - st-theme-node: Recalculate properties on stylesheet changes Ha, could you tell that the method was originally called "on_stylesheets_changed"? Bloody last-minute adjustments ...