[gnome-shell/benzea/systemd-user-units: 48/52] data: Use new method of hiding desktop file from autostart



commit 83ded44bbcaf0cab16151d843e4ccfcd1950e8ac
Author: Benjamin Berg <bberg redhat com>
Date:   Sat Apr 20 00:11:18 2019 +0200

    data: Use new method of hiding desktop file from autostart
    
    GNOME Shell did not bother to hide its desktop file because
    gnome-session would simply ignore all required components and the shell
    was not installed into the XDG autostart directory.
    
    Change this to the new method and update the build files to align closer
    to the other modules.

 data/meson.build                   | 10 ++++++++--
 data/org.gnome.Shell.desktop.in.in |  1 +
 meson.build                        | 16 +++++++---------
 3 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 31ac4514e..138aa3ef8 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -14,6 +14,12 @@ desktopconf = configuration_data()
 # file when built in a non-system prefix
 desktopconf.set('bindir', bindir)
 desktopconf.set('VERSION', meson.project_version())
+if have_systemd
+  desktopconf.set('systemd_hidden', 'X-GNOME-Autostart-systemd=true')
+else
+  desktopconf.set('systemd_hidden', )
+endif
+
 foreach desktop_file : desktop_files
   i18n.merge_file('desktop',
     input: configure_file(
@@ -102,13 +108,13 @@ if have_systemd
     input: 'gnome-shell.service.in',
     output: 'gnome-shell.service',
     configuration: unitconf,
-    install_dir: systemduserunitdir
+    install_dir: systemd_userunitdir
   )
 
   units = files('gnome-shell-wayland.target',
                 'gnome-shell-x11.target')
 
-  install_data(units, install_dir: systemduserunitdir)
+  install_data(units, install_dir: systemd_userunitdir)
 endif
 
 # for unit tests - gnome.compile_schemas() only looks in srcdir
diff --git a/data/org.gnome.Shell.desktop.in.in b/data/org.gnome.Shell.desktop.in.in
index 09543e858..3f41966be 100644
--- a/data/org.gnome.Shell.desktop.in.in
+++ b/data/org.gnome.Shell.desktop.in.in
@@ -14,3 +14,4 @@ X-GNOME-Autostart-Phase=DisplayServer
 X-GNOME-Provides=panel;windowmanager;
 X-GNOME-Autostart-Notify=true
 X-GNOME-AutoRestart=false
+@systemd_hidden@
diff --git a/meson.build b/meson.build
index f85ce116e..2112b474c 100644
--- a/meson.build
+++ b/meson.build
@@ -58,13 +58,6 @@ portaldir = join_paths(datadir, 'xdg-desktop-portal', 'portals')
 schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
 servicedir = join_paths(datadir, 'dbus-1', 'services')
 
-# XXX: Once https://github.com/systemd/systemd/issues/9595 is fixed and we can
-# depend on this version, replace with something like:
-# systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
-#                                                         define_variable: ['prefix', prefix])
-# and uncomment systemd_dep below
-systemduserunitdir = join_paths(prefix, 'lib', 'systemd', 'user')
-
 keybindings_dep = dependency('gnome-keybindings', required: false)
 if keybindings_dep.found()
   keysdir = keybindings_dep.get_pkgconfig_variable('keysdir')
@@ -121,9 +114,14 @@ endif
 
 if get_option('systemd')
   libsystemd_dep = dependency('libsystemd')
-  # XXX: see systemduserunitdir
-  # systemd_dep = dependency('systemd')
+  systemd_dep = dependency('systemd')
   have_systemd = true
+
+  # XXX: Once https://github.com/systemd/systemd/issues/9595 is fixed and we can
+  # depend on this version, replace with something like:
+  # systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
+  #                                                         define_variable: ['prefix', prefix])
+  systemd_userunitdir = join_paths(prefix, 'lib', 'systemd', 'user')
 else
   libsystemd_dep = []
   have_systemd = false


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]