aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-12-21 00:43:40 +0100
committerRobert Tari <robert@tari.in>2020-12-21 02:11:35 +0100
commit85de6718e008d628b84595ff2ca9e1ec86b54eaa (patch)
tree805d49f174faafd78f92cc5af1371c1c78c8bbb3 /src
parent50669befbdd325a3f8bd115152c00b72f5a2e8c5 (diff)
downloadayatana-indicator-bluetooth-85de6718e008d628b84595ff2ca9e1ec86b54eaa.tar.gz
ayatana-indicator-bluetooth-85de6718e008d628b84595ff2ca9e1ec86b54eaa.tar.bz2
ayatana-indicator-bluetooth-85de6718e008d628b84595ff2ca9e1ec86b54eaa.zip
desktop.vala: Do not hide the indicator
fixes #15
Diffstat (limited to 'src')
-rw-r--r--src/desktop.vala9
-rw-r--r--src/killswitch.vala2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/desktop.vala b/src/desktop.vala
index f576144..ea3a806 100644
--- a/src/desktop.vala
+++ b/src/desktop.vala
@@ -64,9 +64,12 @@ class Desktop: Profile
build_menu ();
// know when to show the indicator & when to hide it
- settings.changed["visible"].connect (()=> update_visibility());
- bluetooth.notify["supported"].connect (() => update_visibility());
- update_visibility ();
+ if (Environment.get_variable("MIR_SOCKET") != null)
+ {
+ settings.changed["visible"].connect (()=> update_visibility());
+ bluetooth.notify["supported"].connect (() => update_visibility());
+ update_visibility ();
+ }
// when devices change, rebuild our device section
bluetooth.devices_changed.connect (()=> {
diff --git a/src/killswitch.vala b/src/killswitch.vala
index 4ed87e9..0b900c0 100644
--- a/src/killswitch.vala
+++ b/src/killswitch.vala
@@ -129,7 +129,7 @@ public class RfKillSwitch: KillSwitch, Object
var event = Linux.RfKillEvent();
var n = sizeof (Linux.RfKillEvent);
var bytesread = Posix.read (fd, &event, n);
-
+
if (bytesread == n)
{
process_event (event);