summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-07 13:27:23 +0100
committerinfirit <[email protected]>2014-11-07 14:31:52 +0100
commit97a9f2c181817b09edd0783ed808dbd1ee49b36a (patch)
tree5a00a504d94b363d5ffd57d5777464f21312e9b3
parente98d698c4899ac91e2370252ab67ce91871a72a5 (diff)
downloadmate-session-manager-97a9f2c181817b09edd0783ed808dbd1ee49b36a.tar.bz2
mate-session-manager-97a9f2c181817b09edd0783ed808dbd1ee49b36a.tar.xz
Add an IsSessionRunning method
This gives clients who missed the SessionRunning signal a chance to find out if the session has entered the running phase, and lets us avoid race conditions. Based on gnome-session commit: b59d358796343f81b31d4a398998faedd20b8f4b From: Matthias Clasen <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=636229
-rw-r--r--mate-session/gsm-manager.c11
-rw-r--r--mate-session/gsm-manager.h4
-rw-r--r--mate-session/org.mate.SessionManager.xml16
3 files changed, 30 insertions, 1 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index e814323..2a4d140 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -3942,3 +3942,14 @@ gsm_manager_add_autostart_apps_from_dir (GsmManager *manager,
return TRUE;
}
+
+gboolean
+gsm_manager_is_session_running (GsmManager *manager,
+ gboolean *running,
+ GError **error)
+{
+ g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);
+
+ *running = (manager->priv->phase == GSM_MANAGER_PHASE_RUNNING);
+ return TRUE;
+}
diff --git a/mate-session/gsm-manager.h b/mate-session/gsm-manager.h
index 035d11b..4422f59 100644
--- a/mate-session/gsm-manager.h
+++ b/mate-session/gsm-manager.h
@@ -190,6 +190,10 @@ gboolean gsm_manager_is_autostart_condition_handled (GsmManager *
gboolean gsm_manager_set_phase (GsmManager *manager,
GsmManagerPhase phase);
+gboolean gsm_manager_is_session_running (GsmManager *manager,
+ gboolean *running,
+ GError **error);
+
#ifdef __cplusplus
}
#endif
diff --git a/mate-session/org.mate.SessionManager.xml b/mate-session/org.mate.SessionManager.xml
index 1569cf7..9b6f452 100644
--- a/mate-session/org.mate.SessionManager.xml
+++ b/mate-session/org.mate.SessionManager.xml
@@ -316,7 +316,21 @@
</doc:description>
</doc:doc>
</method>
-
+
+ <method name="IsSessionRunning">
+ <arg name="running" direction="out" type="b">
+ <doc:doc>
+ <doc:summary>True if the session has entered the Running phase, false otherwise</doc:summary>
+ </doc:doc>
+ </arg>
+ <doc:doc>
+ <doc:description>
+ <doc:para>Allows the caller to determine whether the session manager
+ has entered the Running phase, in case the client missed the
+ SessionRunning signal.</doc:para>
+ </doc:description>
+ </doc:doc>
+ </method>
<!-- Signals -->
<signal name="ClientAdded">