diff options
-rw-r--r-- | src/backend-dbus/actions.c | 37 | ||||
-rw-r--r-- | src/backend-dbus/org.gnome.ScreenSaver.xml | 3 |
2 files changed, 25 insertions, 15 deletions
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c index b5810a7..f395e12 100644 --- a/src/backend-dbus/actions.c +++ b/src/backend-dbus/actions.c @@ -777,8 +777,8 @@ my_about (IndicatorSessionActions * self G_GNUC_UNUSED) **** ***/ -static void -lock_current_session (IndicatorSessionActions * self, gboolean immediate) +static gboolean +have_unity_session (IndicatorSessionActions * self) { priv_t * p = INDICATOR_SESSION_ACTIONS_DBUS(self)->priv; gchar * name_owner; @@ -789,20 +789,33 @@ lock_current_session (IndicatorSessionActions * self, gboolean immediate) if (name_owner) { - if (immediate) - { - unity_session_call_prompt_lock (p->unity_session, p->cancellable, NULL, NULL); - } - else - { - unity_session_call_lock (p->unity_session, p->cancellable, NULL, NULL); - } - g_free (name_owner); - return; + return TRUE; } } + return FALSE; +} + +static void +lock_current_session (IndicatorSessionActions * self, gboolean immediate) +{ + priv_t * p = INDICATOR_SESSION_ACTIONS_DBUS(self)->priv; + + if (have_unity_session (self)) + { + if (immediate) + { + unity_session_call_prompt_lock (p->unity_session, p->cancellable, NULL, NULL); + } + else + { + unity_session_call_lock (p->unity_session, p->cancellable, NULL, NULL); + } + + return; + } + g_return_if_fail (p->screen_saver != NULL); gnome_screen_saver_call_lock (p->screen_saver, p->cancellable, NULL, NULL); diff --git a/src/backend-dbus/org.gnome.ScreenSaver.xml b/src/backend-dbus/org.gnome.ScreenSaver.xml index c21fdc5..a1da786 100644 --- a/src/backend-dbus/org.gnome.ScreenSaver.xml +++ b/src/backend-dbus/org.gnome.ScreenSaver.xml @@ -8,9 +8,6 @@ <method name="Lock"> </method> - <method name="SimulateUserActivity"> - </method> - </interface> </node> |