aboutsummaryrefslogtreecommitdiff
path: root/src/settings-daemon.vala
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-05-07 20:53:09 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-05-07 20:53:09 +0200
commit7004a8b66768d6d8f9b358fc6960dab9424514ad (patch)
tree1043bc53c1bb25d386d7ebd59bb9637aa50f204c /src/settings-daemon.vala
parent3c44cdf781d4fcb55b4e0c95043f172f218baaa7 (diff)
parentbfb99d8737fd6c62fa24c6980a4d916008de17c4 (diff)
downloadarctica-greeter-7004a8b66768d6d8f9b358fc6960dab9424514ad.tar.gz
arctica-greeter-7004a8b66768d6d8f9b358fc6960dab9424514ad.tar.bz2
arctica-greeter-7004a8b66768d6d8f9b358fc6960dab9424514ad.zip
Merge branch 'tari01-pr/dbus-server'
Attributes GH PR #46: https://github.com/ArcticaProject/arctica-greeter/pull/46
Diffstat (limited to 'src/settings-daemon.vala')
-rw-r--r--src/settings-daemon.vala42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/settings-daemon.vala b/src/settings-daemon.vala
index 34dd99c..be34e9c 100644
--- a/src/settings-daemon.vala
+++ b/src/settings-daemon.vala
@@ -2,6 +2,7 @@
*
* Copyright (C) 2011 Canonical Ltd
* Copyright (C) 2015,2017 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+ * Copyright (C) 2023 Robert Tari
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -17,6 +18,7 @@
*
* Authored by: Michael Terry <michael.terry@canonical.com>
* Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+ * Robert Tari <robert@tari.in>
*/
public class SettingsDaemon : Object
@@ -223,16 +225,40 @@ public class ScreenSaverInterface : Object
idle_monitor.remove_watch (idle_watch);
idle_watch = 0;
if (value)
- idle_monitor.add_user_active_watch (() => set_active (false));
+ {
+ idle_monitor.add_user_active_watch (() =>
+ {
+ try
+ {
+ set_active (false);
+ }
+ catch (Error pError)
+ {
+ error ("Panic: Screensaver activation failed: %s", pError.message);
+ }
+ });
+ }
else
{
var timeout = AGSettings.get_integer (AGSettings.KEY_IDLE_TIMEOUT);
if (timeout > 0)
- idle_watch = idle_monitor.add_idle_watch (timeout * 1000, () => set_active (true));
+ {
+ idle_watch = idle_monitor.add_idle_watch (timeout * 1000, () =>
+ {
+ try
+ {
+ set_active (true);
+ }
+ catch (Error pError)
+ {
+ error ("Panic: Screensaver activation failed: %s", pError.message);
+ }
+ });
+ }
}
}
- public void set_active (bool value)
+ public void set_active (bool value) throws GLib.DBusError, GLib.IOError
{
if (_active == value)
return;
@@ -246,15 +272,15 @@ public class ScreenSaverInterface : Object
active_changed (value);
}
- public bool get_active ()
+ public bool get_active () throws GLib.DBusError, GLib.IOError
{
return _active;
}
- public uint32 get_active_time () { return 0; }
- public void lock () {}
- public void show_message (string summary, string body, string icon) {}
- public void simulate_user_activity () {}
+ public uint32 get_active_time () throws GLib.DBusError, GLib.IOError { return 0; }
+ public void lock () throws GLib.DBusError, GLib.IOError {}
+ public void show_message (string summary, string body, string icon) throws GLib.DBusError, GLib.IOError {}
+ public void simulate_user_activity () throws GLib.DBusError, GLib.IOError {}
}
[DBus (name="org.gnome.SessionManager")]