common: avoid loading Adwaita CSS theme into memory

Desktop / GNOME / GNOME Settings Daemon - Christian Hergert [] - 28 March 2017 06:02 EDT

The various Gtk programs are not dependent on any specific theme being loaded. Therefore, the parsing the Adwaita CSS theme (which is quite a detailed theme) is unnecessary and a few MB of overhead to each gsd subprocess.

By setting the GTK_THEME environment variable in main() and providing an alternate CSS file (which is empty), we can force Gtk to never load the default theme, but instead our empty theme. This is important as otherwise GtkSettings can force-load Adwaita upon first use, and that fragments the heap.

2088d63 common: avoid loading Adwaita CSS theme into memory | 1 +
plugins/common/ | 10 ++++++++++
plugins/common/ | 34 ++++++++++++++++++++++++++++++++++
plugins/common/daemon-skeleton-gtk.h | 28 ++++++++++++++++++++++++++++
plugins/common/gsd.gresources.xml | 6 ++++++
plugins/common/gtk.css | 0
6 files changed, 79 insertions(+)


  • Share