about summary refs log tree commit diff
path: root/pkgs/desktops/plasma-5/kde-gtk-config
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2020-08-31 10:59:35 -0500
committerThomas Tuegel <ttuegel@mailbox.org>2020-08-31 10:59:35 -0500
commit69ec9ed4e6a5e254fe5651a3342b1e2b9951e0dd (patch)
tree485f6b825b2b32249ed6a6eddc3348ea97ef35b5 /pkgs/desktops/plasma-5/kde-gtk-config
parent81b770fc8c274b55012a316eca9fcb8a77a14b82 (diff)
kde-gtk-config: set GSettings schemas path
Diffstat (limited to 'pkgs/desktops/plasma-5/kde-gtk-config')
-rw-r--r--pkgs/desktops/plasma-5/kde-gtk-config/0001-gsettings-schemas-path.patch21
-rw-r--r--pkgs/desktops/plasma-5/kde-gtk-config/default.nix3
2 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/desktops/plasma-5/kde-gtk-config/0001-gsettings-schemas-path.patch b/pkgs/desktops/plasma-5/kde-gtk-config/0001-gsettings-schemas-path.patch
new file mode 100644
index 0000000000000..2fe4672f6757f
--- /dev/null
+++ b/pkgs/desktops/plasma-5/kde-gtk-config/0001-gsettings-schemas-path.patch
@@ -0,0 +1,21 @@
+diff --git a/kded/gtkconfig.cpp b/kded/gtkconfig.cpp
+index 5303636..199c4d5 100644
+--- a/kded/gtkconfig.cpp
++++ b/kded/gtkconfig.cpp
+@@ -41,6 +41,16 @@ GtkConfig::GtkConfig(QObject *parent, const QVariantList&) :
+     kdeglobalsConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("kdeglobals")))),
+     kwinConfigWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("kwinrc"))))
+ {
++    // Add GSETTINGS_SCHEMAS_PATH to the front of XDG_DATA_DIRS.
++    // Normally this would be done by wrapGAppsHook, but this plugin
++    // (shared object) cannot be wrapped.
++    QByteArray xdgdata = qgetenv("XDG_DATA_DIRS");
++    if (!xdgdata.isEmpty()) {
++        xdgdata.push_front(":");
++    }
++    xdgdata.push_front(QByteArray(GSETTINGS_SCHEMAS_PATH));
++    qputenv("XDG_DATA_DIRS", xdgdata);
++
+     QDBusConnection dbus = QDBusConnection::sessionBus();
+     dbus.registerService(QStringLiteral("org.kde.GtkConfig"));
+     dbus.registerObject(QStringLiteral("/GtkConfig"), this, QDBusConnection::ExportScriptableSlots);
diff --git a/pkgs/desktops/plasma-5/kde-gtk-config/default.nix b/pkgs/desktops/plasma-5/kde-gtk-config/default.nix
index a631efcc95332..c1ed6dbd6c6e6 100644
--- a/pkgs/desktops/plasma-5/kde-gtk-config/default.nix
+++ b/pkgs/desktops/plasma-5/kde-gtk-config/default.nix
@@ -18,6 +18,9 @@ mkDerivation {
     "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
     "-DGLIB_SCHEMAS_DIR=${gsettings-desktop-schemas.out}/"
   ];
+  # The gtkconfig KDED module will crash the daemon if the GSettings schemas
+  # aren't found.
+  patches = [ ./0001-gsettings-schemas-path.patch ];
   preConfigure = ''
     NIX_CFLAGS_COMPILE+=" -DGSETTINGS_SCHEMAS_PATH=\"$GSETTINGS_SCHEMAS_PATH\""
   '';