summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2020-10-20 12:50:48 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2020-10-20 12:50:48 +0100
commite8d9fc565b2de0fa0cea39ce96b18a53bdb6fe8f (patch)
tree60ef4ac7023a3089cb61d8f706909e30cfca7864
parent3b579a3172507a2b10432fcb135ba2ab1fcf831c (diff)
downloadgnome-control-center-e8d9fc565b2de0fa0cea39ce96b18a53bdb6fe8f.tar.gz
user-accounts: Pass --user argument to select user in malcontent-control
This eases the transition from g-c-c to malcontent-control a little. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: https://gitlab.freedesktop.org/pwithnall/malcontent/-/issues/19
-rw-r--r--meson.build2
-rw-r--r--panels/user-accounts/cc-user-panel.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index a2405087a..22b9f8241 100644
--- a/meson.build
+++ b/meson.build
@@ -210,6 +210,8 @@ config_h.set('HAVE_SNAP', enable_snap,
enable_malcontent = get_option('malcontent')
if enable_malcontent
malcontent_dep = dependency('malcontent-0', version: '>= 0.7.0')
+ config_h.set('HAVE_MALCONTENT_0_10', malcontent_dep.version().version_compare('>= 0.10.0'),
+ description: 'Define to 1 if malcontent ≥ 0.10.0')
endif
config_h.set('HAVE_MALCONTENT', enable_malcontent,
description: 'Define to 1 if malcontent support is enabled')
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index 5a9b5c221..c6d2fcb74 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -1223,7 +1223,14 @@ spawn_malcontent_control (CcUserPanel *self)
/* no-op if the user is administrator */
if (act_user_get_account_type (user) != ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR) {
- const gchar *argv[] = { "malcontent-control", NULL };
+ const gchar *argv[] = {
+ "malcontent-control",
+#ifdef HAVE_MALCONTENT_0_10
+ "--user",
+ act_user_get_user_name (user),
+#endif /* HAVE_MALCONTENT_0_10 */
+ NULL
+ };
g_spawn_async (NULL, (char **)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
}
}