aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2023-10-06 12:39:28 +0200
committerMihai Moldovan <ionic@ionic.de>2023-10-06 12:39:28 +0200
commit57838b0b9a9bd91114c0473e963dac6199cc5888 (patch)
tree7999170c0e7e8ef2df252c3ec4a02a6fccc155de /src
parentfc424c81c3a4e305cdcd35c80a7b7cea800433c4 (diff)
parent9f1c482aaacb5aeb74aee9f84102642dda1333da (diff)
downloadarctica-greeter-57838b0b9a9bd91114c0473e963dac6199cc5888.tar.gz
arctica-greeter-57838b0b9a9bd91114c0473e963dac6199cc5888.tar.bz2
arctica-greeter-57838b0b9a9bd91114c0473e963dac6199cc5888.zip
Merge branch 'sunweaver-mr/earlier-env-var-setup'
Attributes GH PR #83: https://github.com/ArcticaProject/arctica-greeter/pull/83
Diffstat (limited to 'src')
-rw-r--r--src/arctica-greeter.vala16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index fc6f0cc..dabf64e 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -937,6 +937,9 @@ public class ArcticaGreeter : Object
log_timer = new Timer ();
Log.set_default_handler (log_cb);
+ /* Make nm-applet hide items the user does not have permissions to interact with */
+ Environment.set_variable ("NM_APPLET_HIDE_POLICY_ITEMS", "1", true);
+
bool do_show_version = false;
bool do_test_mode = false;
bool do_test_highcontrast = false;
@@ -960,6 +963,16 @@ public class ArcticaGreeter : Object
c.add_main_entries (options, Config.GETTEXT_PACKAGE);
c.add_group (Gtk.get_option_group (true));
+ /*
+ * IMPORTANT: environment variable setup must go above this comment
+ *
+ * GLib.Environment.set_variable() calls won't take effect (for
+ * whatever unknown reason...) if they get issued after the c.parse()
+ * method call on our OptionContext object (see a few lines below).
+ *
+ * To mitigate this (strange) behaviour, make sure that all env
+ * variable setups in main() are located above this comment.
+ */
try
{
c.parse (ref args);
@@ -1192,9 +1205,6 @@ public class ArcticaGreeter : Object
}
- /* Make nm-applet hide items the user does not have permissions to interact with */
- Environment.set_variable ("NM_APPLET_HIDE_POLICY_ITEMS", "1", true);
-
try
{
string[] argv;