common: avoid loading Adwaita CSS theme into memory

Desktop / GNOME / GNOME Settings Daemon - Christian Hergert [redhat.com] - 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.

https://bugzilla.gnome.org/show_bug.cgi?id=780555

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

Upstream: git.gnome.org


  • Share