Merge lp:~laney/indicator-session/logind-port into lp:indicator-session/13.10
- logind-port
- Merge into trunk.13.10
Proposed by
Iain Lane
Status: | Merged |
---|---|
Approved by: | Mathieu Trudel-Lapierre |
Approved revision: | 393 |
Merged at revision: | 388 |
Proposed branch: | lp:~laney/indicator-session/logind-port |
Merge into: | lp:indicator-session/13.10 |
Diff against target: |
2813 lines (+657/-1650) 14 files modified
src/Makefile.am (+39/-53) src/dialog.c (+17/-17) src/gtk-logout-helper.c (+14/-16) src/org.freedesktop.ConsoleKit.Manager.xml (+0/-353) src/org.freedesktop.ConsoleKit.Seat.xml (+0/-164) src/org.freedesktop.ConsoleKit.Session.xml (+0/-435) src/org.freedesktop.login1.Manager.xml (+199/-0) src/org.freedesktop.login1.Seat.xml (+21/-0) src/org.freedesktop.login1.Session.xml (+49/-0) src/org.freedesktop.login1.User.xml (+56/-0) src/session-menu-mgr.c (+58/-100) src/upower.xml (+0/-309) src/users-service-dbus.c (+202/-200) src/users-service-dbus.h (+2/-3) |
To merge this branch: | bzr merge lp:~laney/indicator-session/logind-port |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mathieu Trudel-Lapierre | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+160096@code.launchpad.net |
Commit message
Stop using ConsoleKit and UPower for session tracking and shutdown/
Description of the change
Stop using ConsoleKit and UPower; migrate to logind.
I don't know the proper way to get the .xml files for input to gdbus-codegen so I generated these with gdbus introspect --xml. Hope that's OK, otherwise I'm happy to fix it if someone can tell me what the proper way is. :-)
Style error spotting appreciated. After a while you stop being able to notice such things.
To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : | # |
review:
Approve
(continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote : | # |
Should get rid of that comment too:
1845 /* maybe the seat doesn't support activation */
The rest looks fine to me.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/Makefile.am' | |||
2 | --- src/Makefile.am 2012-10-03 19:35:57 +0000 | |||
3 | +++ src/Makefile.am 2013-04-22 12:49:38 +0000 | |||
4 | @@ -43,34 +43,34 @@ | |||
5 | 43 | --generate-c-code dbus-display-manager \ | 43 | --generate-c-code dbus-display-manager \ |
6 | 44 | $^ | 44 | $^ |
7 | 45 | 45 | ||
36 | 46 | dbus_consolekit_manager_sources = \ | 46 | dbus_login1_manager_sources = \ |
37 | 47 | dbus-consolekit-manager.c \ | 47 | dbus-login1-manager.c \ |
38 | 48 | dbus-consolekit-manager.h | 48 | dbus-login1-manager.h |
39 | 49 | 49 | ||
40 | 50 | $(dbus_consolekit_manager_sources): org.freedesktop.ConsoleKit.Manager.xml | 50 | $(dbus_login1_manager_sources): org.freedesktop.login1.Manager.xml |
41 | 51 | $(AM_V_GEN) gdbus-codegen \ | 51 | $(AM_V_GEN) gdbus-codegen \ |
42 | 52 | --interface-prefix org.freedesktop \ | 52 | --interface-prefix org.freedesktop \ |
43 | 53 | --generate-c-code dbus-consolekit-manager \ | 53 | --generate-c-code dbus-login1-manager \ |
44 | 54 | $^ | 54 | $^ |
45 | 55 | 55 | ||
46 | 56 | dbus_consolekit_seat_sources = \ | 56 | dbus_login1_session_sources = \ |
47 | 57 | dbus-consolekit-seat.c \ | 57 | dbus-login1-session.c \ |
48 | 58 | dbus-consolekit-seat.h | 58 | dbus-login1-session.h |
49 | 59 | 59 | ||
50 | 60 | $(dbus_consolekit_seat_sources): org.freedesktop.ConsoleKit.Seat.xml | 60 | $(dbus_login1_session_sources): org.freedesktop.login1.Session.xml |
51 | 61 | $(AM_V_GEN) gdbus-codegen \ | 61 | $(AM_V_GEN) gdbus-codegen \ |
52 | 62 | --interface-prefix org.freedesktop \ | 62 | --interface-prefix org.freedesktop \ |
53 | 63 | --generate-c-code dbus-consolekit-seat \ | 63 | --generate-c-code dbus-login1-session \ |
54 | 64 | $^ | 64 | $^ |
55 | 65 | 65 | ||
56 | 66 | dbus_consolekit_session_sources = \ | 66 | dbus_login1_user_sources = \ |
57 | 67 | dbus-consolekit-session.c \ | 67 | dbus-login1-user.c \ |
58 | 68 | dbus-consolekit-session.h | 68 | dbus-login1-user.h |
59 | 69 | 69 | ||
60 | 70 | $(dbus_consolekit_session_sources): org.freedesktop.ConsoleKit.Session.xml | 70 | $(dbus_login1_user_sources): org.freedesktop.login1.User.xml |
61 | 71 | $(AM_V_GEN) gdbus-codegen \ | 71 | $(AM_V_GEN) gdbus-codegen \ |
62 | 72 | --interface-prefix org.freedesktop \ | 72 | --interface-prefix org.freedesktop \ |
63 | 73 | --generate-c-code dbus-consolekit-session \ | 73 | --generate-c-code dbus-login1-user \ |
64 | 74 | $^ | 74 | $^ |
65 | 75 | 75 | ||
66 | 76 | dbus_accounts_sources = \ | 76 | dbus_accounts_sources = \ |
67 | @@ -92,17 +92,6 @@ | |||
68 | 92 | --interface-prefix org.freedesktop \ | 92 | --interface-prefix org.freedesktop \ |
69 | 93 | --generate-c-code dbus-user \ | 93 | --generate-c-code dbus-user \ |
70 | 94 | $^ | 94 | $^ |
71 | 95 | |||
72 | 96 | dbus_upower_sources = \ | ||
73 | 97 | dbus-upower.c \ | ||
74 | 98 | dbus-upower.h | ||
75 | 99 | |||
76 | 100 | $(dbus_upower_sources): upower.xml | ||
77 | 101 | $(AM_V_GEN) gdbus-codegen \ | ||
78 | 102 | --interface-prefix org.freedesktop \ | ||
79 | 103 | --generate-c-code dbus-upower \ | ||
80 | 104 | --c-namespace DBus \ | ||
81 | 105 | $^ | ||
82 | 106 | 95 | ||
83 | 107 | gen-%.xml.c: %.xml | 96 | gen-%.xml.c: %.xml |
84 | 108 | @echo "Building $@ from $<" | 97 | @echo "Building $@ from $<" |
85 | @@ -120,11 +109,10 @@ | |||
86 | 120 | 109 | ||
87 | 121 | indicator_session_service_SOURCES = \ | 110 | indicator_session_service_SOURCES = \ |
88 | 122 | $(dbus_accounts_sources) \ | 111 | $(dbus_accounts_sources) \ |
92 | 123 | $(dbus_consolekit_manager_sources) \ | 112 | $(dbus_login1_manager_sources) \ |
93 | 124 | $(dbus_consolekit_seat_sources) \ | 113 | $(dbus_login1_user_sources) \ |
94 | 125 | $(dbus_consolekit_session_sources) \ | 114 | $(dbus_login1_session_sources) \ |
95 | 126 | $(dbus_display_manager_sources) \ | 115 | $(dbus_display_manager_sources) \ |
96 | 127 | $(dbus_upower_sources) \ | ||
97 | 128 | $(dbus_user_sources) \ | 116 | $(dbus_user_sources) \ |
98 | 129 | session-service.c \ | 117 | session-service.c \ |
99 | 130 | session-dbus.c \ | 118 | session-dbus.c \ |
100 | @@ -156,7 +144,7 @@ | |||
101 | 156 | 144 | ||
102 | 157 | if BUILD_GTKLOGOUTHELPER | 145 | if BUILD_GTKLOGOUTHELPER |
103 | 158 | gtk_logout_helper_SOURCES = \ | 146 | gtk_logout_helper_SOURCES = \ |
105 | 159 | $(dbus_consolekit_manager_sources) \ | 147 | $(dbus_login1_manager_sources) \ |
106 | 160 | gtk-logout-helper.c \ | 148 | gtk-logout-helper.c \ |
107 | 161 | dialog.c \ | 149 | dialog.c \ |
108 | 162 | dialog.h | 150 | dialog.h |
109 | @@ -185,11 +173,10 @@ | |||
110 | 185 | 173 | ||
111 | 186 | BUILT_SOURCES = \ | 174 | BUILT_SOURCES = \ |
112 | 187 | $(dbus_accounts_sources) \ | 175 | $(dbus_accounts_sources) \ |
116 | 188 | $(dbus_consolekit_manager_sources) \ | 176 | $(dbus_login1_manager_sources) \ |
117 | 189 | $(dbus_consolekit_seat_sources) \ | 177 | $(dbus_login1_user_sources) \ |
118 | 190 | $(dbus_consolekit_session_sources) \ | 178 | $(dbus_login1_session_sources) \ |
119 | 191 | $(dbus_display_manager_sources) \ | 179 | $(dbus_display_manager_sources) \ |
120 | 192 | $(dbus_upower_sources) \ | ||
121 | 193 | $(dbus_user_sources) \ | 180 | $(dbus_user_sources) \ |
122 | 194 | gen-session-dbus.xml.c \ | 181 | gen-session-dbus.xml.c \ |
123 | 195 | gen-session-dbus.xml.h | 182 | gen-session-dbus.xml.h |
124 | @@ -198,10 +185,9 @@ | |||
125 | 198 | display-manager.xml \ | 185 | display-manager.xml \ |
126 | 199 | org.freedesktop.Accounts.User.xml \ | 186 | org.freedesktop.Accounts.User.xml \ |
127 | 200 | org.freedesktop.Accounts.xml \ | 187 | org.freedesktop.Accounts.xml \ |
133 | 201 | org.freedesktop.ConsoleKit.Manager.xml \ | 188 | org.freedesktop.login1.Manager.xml \ |
134 | 202 | org.freedesktop.ConsoleKit.Seat.xml \ | 189 | org.freedesktop.login1.Session.xml \ |
135 | 203 | org.freedesktop.ConsoleKit.Session.xml \ | 190 | org.freedesktop.login1.User.xml \ |
136 | 204 | session-dbus.xml \ | 191 | session-dbus.xml |
132 | 205 | upower.xml | ||
137 | 206 | 192 | ||
138 | 207 | CLEANFILES += $(BUILT_SOURCES) | 193 | CLEANFILES += $(BUILT_SOURCES) |
139 | 208 | 194 | ||
140 | === modified file 'src/dialog.c' | |||
141 | --- src/dialog.c 2012-10-03 19:35:57 +0000 | |||
142 | +++ src/dialog.c 2013-04-22 12:49:38 +0000 | |||
143 | @@ -26,7 +26,7 @@ | |||
144 | 26 | 26 | ||
145 | 27 | #include <glib/gi18n.h> | 27 | #include <glib/gi18n.h> |
146 | 28 | 28 | ||
148 | 29 | #include "dbus-consolekit-manager.h" | 29 | #include "dbus-login1-manager.h" |
149 | 30 | #include "dialog.h" | 30 | #include "dialog.h" |
150 | 31 | 31 | ||
151 | 32 | /* Strings */ | 32 | /* Strings */ |
152 | @@ -133,35 +133,35 @@ | |||
153 | 133 | return g_file_test("/var/run/reboot-required", G_FILE_TEST_EXISTS); | 133 | return g_file_test("/var/run/reboot-required", G_FILE_TEST_EXISTS); |
154 | 134 | } | 134 | } |
155 | 135 | 135 | ||
157 | 136 | /* Checks with console kit to see if we can do what we want */ | 136 | /* Checks with logind to see if we can do what we want */ |
158 | 137 | static gboolean | 137 | static gboolean |
160 | 138 | ck_check_allowed (LogoutDialogType type) | 138 | logind_check_allowed (LogoutDialogType type) |
161 | 139 | { | 139 | { |
163 | 140 | gboolean allowed = TRUE; | 140 | gchar * allowed = NULL; |
164 | 141 | 141 | ||
172 | 142 | ConsoleKitManager * ck_proxy = console_kit_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, | 142 | Login1Manager * manager_proxy = login1_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, |
173 | 143 | G_DBUS_PROXY_FLAGS_NONE, | 143 | G_DBUS_PROXY_FLAGS_NONE, |
174 | 144 | "org.freedesktop.ConsoleKit", | 144 | "org.freedesktop.login1", |
175 | 145 | "/org/freedesktop/ConsoleKit/Manager", | 145 | "/org/freedesktop/login1", |
176 | 146 | NULL, | 146 | NULL, |
177 | 147 | NULL); | 147 | NULL); |
178 | 148 | if (ck_proxy != NULL) | 148 | if (manager_proxy != NULL) |
179 | 149 | { | 149 | { |
180 | 150 | switch (type) { | 150 | switch (type) { |
181 | 151 | case LOGOUT_DIALOG_TYPE_RESTART: | 151 | case LOGOUT_DIALOG_TYPE_RESTART: |
183 | 152 | console_kit_manager_call_can_restart_sync (ck_proxy, &allowed, NULL, NULL); | 152 | login1_manager_call_can_reboot_sync (manager_proxy, &allowed, NULL, NULL); |
184 | 153 | break; | 153 | break; |
185 | 154 | case LOGOUT_DIALOG_TYPE_SHUTDOWN: | 154 | case LOGOUT_DIALOG_TYPE_SHUTDOWN: |
187 | 155 | console_kit_manager_call_can_stop_sync (ck_proxy, &allowed, NULL, NULL); | 155 | login1_manager_call_can_power_off_sync (manager_proxy, &allowed, NULL, NULL); |
188 | 156 | break; | 156 | break; |
189 | 157 | default: | 157 | default: |
190 | 158 | break; | 158 | break; |
191 | 159 | } | 159 | } |
192 | 160 | 160 | ||
194 | 161 | g_object_unref(ck_proxy); | 161 | g_object_unref(manager_proxy); |
195 | 162 | } | 162 | } |
196 | 163 | 163 | ||
198 | 164 | return allowed; | 164 | return g_strcmp0 (allowed, "yes") == 0; |
199 | 165 | } | 165 | } |
200 | 166 | 166 | ||
201 | 167 | LogoutDialog * | 167 | LogoutDialog * |
202 | @@ -188,9 +188,9 @@ | |||
203 | 188 | 188 | ||
204 | 189 | gboolean allowed = FALSE; | 189 | gboolean allowed = FALSE; |
205 | 190 | if (type == LOGOUT_DIALOG_TYPE_LOG_OUT) { | 190 | if (type == LOGOUT_DIALOG_TYPE_LOG_OUT) { |
207 | 191 | allowed = ck_check_allowed(LOGOUT_DIALOG_TYPE_RESTART); | 191 | allowed = logind_check_allowed(LOGOUT_DIALOG_TYPE_RESTART); |
208 | 192 | } else { | 192 | } else { |
210 | 193 | allowed = ck_check_allowed(type); | 193 | allowed = logind_check_allowed(type); |
211 | 194 | } | 194 | } |
212 | 195 | 195 | ||
213 | 196 | gboolean restart_required = FALSE; | 196 | gboolean restart_required = FALSE; |
214 | 197 | 197 | ||
215 | === modified file 'src/gtk-logout-helper.c' | |||
216 | --- src/gtk-logout-helper.c 2012-11-29 22:09:57 +0000 | |||
217 | +++ src/gtk-logout-helper.c 2013-04-22 12:49:38 +0000 | |||
218 | @@ -31,7 +31,7 @@ | |||
219 | 31 | #include "shared-names.h" | 31 | #include "shared-names.h" |
220 | 32 | 32 | ||
221 | 33 | static GVariant * | 33 | static GVariant * |
223 | 34 | call_console_kit (const gchar *method, GVariant *parameters, GError **error) | 34 | call_logind (const gchar *method, GVariant *parameters, GError **error) |
224 | 35 | { | 35 | { |
225 | 36 | GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, error); | 36 | GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, error); |
226 | 37 | if (!bus) | 37 | if (!bus) |
227 | @@ -41,9 +41,9 @@ | |||
228 | 41 | } | 41 | } |
229 | 42 | 42 | ||
230 | 43 | GVariant *result = g_dbus_connection_call_sync(bus, | 43 | GVariant *result = g_dbus_connection_call_sync(bus, |
234 | 44 | "org.freedesktop.ConsoleKit", | 44 | "org.freedesktop.login1", |
235 | 45 | "/org/freedesktop/ConsoleKit/Manager", | 45 | "/org/freedesktop/login1", |
236 | 46 | "org.freedesktop.ConsoleKit.Manager", | 46 | "org.freedesktop.login1.Manager", |
237 | 47 | method, | 47 | method, |
238 | 48 | parameters, | 48 | parameters, |
239 | 49 | NULL, | 49 | NULL, |
240 | @@ -57,24 +57,24 @@ | |||
241 | 57 | } | 57 | } |
242 | 58 | 58 | ||
243 | 59 | static void | 59 | static void |
245 | 60 | consolekit_fallback (LogoutDialogType action) | 60 | logind_fallback (LogoutDialogType action) |
246 | 61 | { | 61 | { |
247 | 62 | GError * error = NULL; | 62 | GError * error = NULL; |
248 | 63 | GVariant *result = NULL; | 63 | GVariant *result = NULL; |
249 | 64 | 64 | ||
251 | 65 | g_debug("Falling back to using ConsoleKit for action"); | 65 | g_debug("Falling back to using logind for action"); |
252 | 66 | 66 | ||
253 | 67 | switch (action) { | 67 | switch (action) { |
254 | 68 | case LOGOUT_DIALOG_TYPE_LOG_OUT: | 68 | case LOGOUT_DIALOG_TYPE_LOG_OUT: |
256 | 69 | g_warning("Unable to fallback to ConsoleKit for logout as it's a session issue. We need some sort of session handler."); | 69 | g_warning("Unable to fallback to logind for logout as it's a session issue. We need some sort of session handler."); |
257 | 70 | break; | 70 | break; |
258 | 71 | case LOGOUT_DIALOG_TYPE_SHUTDOWN: | 71 | case LOGOUT_DIALOG_TYPE_SHUTDOWN: |
261 | 72 | g_debug("Telling ConsoleKit to 'Stop'"); | 72 | g_debug("Telling logind to 'PowerOff'"); |
262 | 73 | result = call_console_kit ("Stop", g_variant_new ("()"), &error); | 73 | result = call_logind ("PowerOff", g_variant_new ("(b)", FALSE), &error); |
263 | 74 | break; | 74 | break; |
264 | 75 | case LOGOUT_DIALOG_TYPE_RESTART: | 75 | case LOGOUT_DIALOG_TYPE_RESTART: |
267 | 76 | g_debug("Telling ConsoleKit to 'Restart'"); | 76 | g_debug("Telling logind to 'Reboot'"); |
268 | 77 | result = call_console_kit ("Restart", g_variant_new ("()"), &error); | 77 | result = call_logind ("Reboot", g_variant_new ("(b)", FALSE), &error); |
269 | 78 | break; | 78 | break; |
270 | 79 | default: | 79 | default: |
271 | 80 | g_warning("Unknown action"); | 80 | g_warning("Unknown action"); |
272 | @@ -83,12 +83,10 @@ | |||
273 | 83 | 83 | ||
274 | 84 | if (!result) { | 84 | if (!result) { |
275 | 85 | if (error != NULL) { | 85 | if (error != NULL) { |
277 | 86 | g_warning ("ConsoleKit action failed: %s", error->message); | 86 | g_warning ("logind action failed: %s", error->message); |
278 | 87 | } else { | 87 | } else { |
280 | 88 | g_warning ("ConsoleKit action failed: unknown error"); | 88 | g_warning ("logind action failed: unknown error"); |
281 | 89 | } | 89 | } |
282 | 90 | |||
283 | 91 | consolekit_fallback(action); | ||
284 | 92 | } | 90 | } |
285 | 93 | else | 91 | else |
286 | 94 | g_variant_unref (result); | 92 | g_variant_unref (result); |
287 | @@ -149,7 +147,7 @@ | |||
288 | 149 | g_warning ("SessionManager action failed: unknown error"); | 147 | g_warning ("SessionManager action failed: unknown error"); |
289 | 150 | } | 148 | } |
290 | 151 | 149 | ||
292 | 152 | consolekit_fallback(action); | 150 | logind_fallback(action); |
293 | 153 | } | 151 | } |
294 | 154 | else | 152 | else |
295 | 155 | g_variant_unref (result); | 153 | g_variant_unref (result); |
296 | 156 | 154 | ||
297 | === removed file 'src/org.freedesktop.ConsoleKit.Manager.xml' | |||
298 | --- src/org.freedesktop.ConsoleKit.Manager.xml 2011-08-17 20:53:51 +0000 | |||
299 | +++ src/org.freedesktop.ConsoleKit.Manager.xml 1970-01-01 00:00:00 +0000 | |||
300 | @@ -1,353 +0,0 @@ | |||
301 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
302 | 2 | <node name="/org/freedesktop/ConsoleKit/Manager" | ||
303 | 3 | xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd" | ||
304 | 4 | > | ||
305 | 5 | |||
306 | 6 | <interface name="org.freedesktop.ConsoleKit.Manager"> | ||
307 | 7 | <method name="Restart"> | ||
308 | 8 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
309 | 9 | <doc:doc> | ||
310 | 10 | <doc:description> | ||
311 | 11 | <doc:para>This method initiates a request to restart (ie. reboot) the computer system.</doc:para> | ||
312 | 12 | </doc:description> | ||
313 | 13 | </doc:doc> | ||
314 | 14 | </method> | ||
315 | 15 | |||
316 | 16 | <method name="CanRestart"> | ||
317 | 17 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
318 | 18 | <arg name="can_restart" type="b" direction="out"/> | ||
319 | 19 | </method> | ||
320 | 20 | |||
321 | 21 | <method name="Stop"> | ||
322 | 22 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
323 | 23 | <doc:doc> | ||
324 | 24 | <doc:description> | ||
325 | 25 | <doc:para>This method initiates a request to stop (ie. shutdown) the computer system.</doc:para> | ||
326 | 26 | </doc:description> | ||
327 | 27 | </doc:doc> | ||
328 | 28 | </method> | ||
329 | 29 | |||
330 | 30 | <method name="CanStop"> | ||
331 | 31 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
332 | 32 | <arg name="can_stop" type="b" direction="out"/> | ||
333 | 33 | </method> | ||
334 | 34 | |||
335 | 35 | <method name="OpenSession"> | ||
336 | 36 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
337 | 37 | <arg name="cookie" direction="out" type="s"> | ||
338 | 38 | <doc:doc> | ||
339 | 39 | <doc:summary>The secret cookie that is used to identify the new session</doc:summary> | ||
340 | 40 | </doc:doc> | ||
341 | 41 | </arg> | ||
342 | 42 | <doc:doc> | ||
343 | 43 | <doc:description> | ||
344 | 44 | <doc:para>This method requests that a new <doc:ref type="interface" to="Session">Session</doc:ref> | ||
345 | 45 | be created for the calling process. The properties of this new Session are set automatically | ||
346 | 46 | from information collected about the calling process. | ||
347 | 47 | </doc:para> | ||
348 | 48 | <doc:para>This new session exists until the calling process disconnects from the system bus or | ||
349 | 49 | calls <doc:ref type="method" to="Manager.CloseSession">CloseSession()</doc:ref>. | ||
350 | 50 | </doc:para> | ||
351 | 51 | <doc:para>It is the responsibility of the calling process to set the environment variable | ||
352 | 52 | XDG_SESSION_COOKIE to the value of the returned cookie. This cookie should only | ||
353 | 53 | be made available to child processes of the caller so that they may be identified | ||
354 | 54 | as members of this session. | ||
355 | 55 | </doc:para> | ||
356 | 56 | <doc:para>See this simple example: | ||
357 | 57 | <doc:example language="c" title="simple example"><doc:code> | ||
358 | 58 | DBusError error; | ||
359 | 59 | DBusMessage *message; | ||
360 | 60 | DBusMessage *reply; | ||
361 | 61 | |||
362 | 62 | message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit", | ||
363 | 63 | "/org/freedesktop/ConsoleKit/Manager", | ||
364 | 64 | "org.freedesktop.ConsoleKit.Manager", | ||
365 | 65 | "OpenSession"); | ||
366 | 66 | if (message == NULL) { | ||
367 | 67 | goto out; | ||
368 | 68 | } | ||
369 | 69 | |||
370 | 70 | dbus_error_init (&error); | ||
371 | 71 | reply = dbus_connection_send_with_reply_and_block (connector->connection, | ||
372 | 72 | message, | ||
373 | 73 | -1, | ||
374 | 74 | &error); | ||
375 | 75 | if (reply == NULL) { | ||
376 | 76 | goto out; | ||
377 | 77 | } | ||
378 | 78 | |||
379 | 79 | dbus_error_init (&error); | ||
380 | 80 | if (! dbus_message_get_args (reply, | ||
381 | 81 | &error, | ||
382 | 82 | DBUS_TYPE_STRING, &cookie, | ||
383 | 83 | DBUS_TYPE_INVALID)) { | ||
384 | 84 | goto out; | ||
385 | 85 | } | ||
386 | 86 | |||
387 | 87 | </doc:code></doc:example></doc:para> | ||
388 | 88 | </doc:description> | ||
389 | 89 | <doc:seealso><doc:ref type="method" to="Manager.OpenSessionWithParameters">OpenSessionWithParameters()</doc:ref></doc:seealso> | ||
390 | 90 | </doc:doc> | ||
391 | 91 | </method> | ||
392 | 92 | <method name="OpenSessionWithParameters"> | ||
393 | 93 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
394 | 94 | <arg name="parameters" direction="in" type="a(sv)"> | ||
395 | 95 | <doc:doc> | ||
396 | 96 | <doc:summary>An array of sets of property names and values</doc:summary> | ||
397 | 97 | </doc:doc> | ||
398 | 98 | </arg> | ||
399 | 99 | <arg name="cookie" direction="out" type="s"> | ||
400 | 100 | <doc:doc> | ||
401 | 101 | <doc:summary>The secret cookie that is used to identify the new session</doc:summary> | ||
402 | 102 | </doc:doc> | ||
403 | 103 | </arg> | ||
404 | 104 | <doc:doc> | ||
405 | 105 | <doc:description> | ||
406 | 106 | <doc:para>This method requests that a new <doc:ref type="interface" to="Session">Session</doc:ref> | ||
407 | 107 | be created for the calling process. The properties of this new Session are from the | ||
408 | 108 | parameters provided. | ||
409 | 109 | </doc:para> | ||
410 | 110 | <doc:para>This new session exists until the calling process disconnects from the system bus or | ||
411 | 111 | calls <doc:ref type="method" to="Manager.CloseSession">CloseSession()</doc:ref>. | ||
412 | 112 | </doc:para> | ||
413 | 113 | <doc:para>It is the responsibility of the calling process to set the environment variable | ||
414 | 114 | XDG_SESSION_COOKIE to the value of the returned cookie. This cookie should only | ||
415 | 115 | be made available to child processes of the caller so that they may be identified | ||
416 | 116 | as members of this session. | ||
417 | 117 | </doc:para> | ||
418 | 118 | <doc:para>See the <doc:ref type="interface" to="Session">Session</doc:ref> properties for a list of valid parameters.</doc:para> | ||
419 | 119 | </doc:description> | ||
420 | 120 | <doc:seealso><doc:ref type="interface" to="Session">org.freedesktop.ConsoleKit.Session</doc:ref></doc:seealso> | ||
421 | 121 | <doc:permission>This method is restricted to privileged users by D-Bus policy.</doc:permission> | ||
422 | 122 | </doc:doc> | ||
423 | 123 | </method> | ||
424 | 124 | <method name="CloseSession"> | ||
425 | 125 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
426 | 126 | <arg name="cookie" direction="in" type="s"> | ||
427 | 127 | <doc:doc> | ||
428 | 128 | <doc:summary>The secret cookie that is used to identify the session</doc:summary> | ||
429 | 129 | </doc:doc> | ||
430 | 130 | </arg> | ||
431 | 131 | <arg name="result" direction="out" type="b"> | ||
432 | 132 | <doc:doc> | ||
433 | 133 | <doc:summary>Whether the session was successfully closed</doc:summary> | ||
434 | 134 | </doc:doc> | ||
435 | 135 | </arg> | ||
436 | 136 | <doc:doc> | ||
437 | 137 | <doc:description> | ||
438 | 138 | <doc:para>This method is used to close the session identified by the supplied cookie. | ||
439 | 139 | </doc:para> | ||
440 | 140 | <doc:para>The session can only be closed by the same process that opened the session. | ||
441 | 141 | </doc:para> | ||
442 | 142 | </doc:description> | ||
443 | 143 | </doc:doc> | ||
444 | 144 | </method> | ||
445 | 145 | |||
446 | 146 | <method name="GetSeats"> | ||
447 | 147 | <arg name="seats" direction="out" type="ao"> | ||
448 | 148 | <doc:doc> | ||
449 | 149 | <doc:summary>an array of Seat IDs</doc:summary> | ||
450 | 150 | </doc:doc> | ||
451 | 151 | </arg> | ||
452 | 152 | <doc:doc> | ||
453 | 153 | <doc:description> | ||
454 | 154 | <doc:para>This gets a list of all the <doc:ref type="interface" to="Seat">Seats</doc:ref> | ||
455 | 155 | that are currently present on the system.</doc:para> | ||
456 | 156 | <doc:para>Each Seat ID is an D-Bus object path for the object that implements the | ||
457 | 157 | <doc:ref type="interface" to="Seat">Seat</doc:ref> interface.</doc:para> | ||
458 | 158 | </doc:description> | ||
459 | 159 | <doc:seealso><doc:ref type="interface" to="Seat">org.freedesktop.ConsoleKit.Seat</doc:ref></doc:seealso> | ||
460 | 160 | </doc:doc> | ||
461 | 161 | </method> | ||
462 | 162 | |||
463 | 163 | <method name="GetSessions"> | ||
464 | 164 | <arg name="sessions" direction="out" type="ao"> | ||
465 | 165 | <doc:doc> | ||
466 | 166 | <doc:summary>an array of Session IDs</doc:summary> | ||
467 | 167 | </doc:doc> | ||
468 | 168 | </arg> | ||
469 | 169 | <doc:doc> | ||
470 | 170 | <doc:description> | ||
471 | 171 | <doc:para>This gets a list of all the <doc:ref type="interface" to="Session">Sessions</doc:ref> | ||
472 | 172 | that are currently present on the system.</doc:para> | ||
473 | 173 | <doc:para>Each Session ID is an D-Bus object path for the object that implements the | ||
474 | 174 | <doc:ref type="interface" to="Session">Session</doc:ref> interface.</doc:para> | ||
475 | 175 | </doc:description> | ||
476 | 176 | <doc:seealso><doc:ref type="interface" to="Session">org.freedesktop.ConsoleKit.Session</doc:ref></doc:seealso> | ||
477 | 177 | </doc:doc> | ||
478 | 178 | </method> | ||
479 | 179 | |||
480 | 180 | <method name="GetSessionForCookie"> | ||
481 | 181 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
482 | 182 | <arg name="cookie" direction="in" type="s"> | ||
483 | 183 | <doc:doc> | ||
484 | 184 | <doc:summary>The secret cookie that is used to identify the session</doc:summary> | ||
485 | 185 | </doc:doc> | ||
486 | 186 | </arg> | ||
487 | 187 | <arg name="ssid" direction="out" type="o"> | ||
488 | 188 | <doc:doc> | ||
489 | 189 | <doc:summary>The object identifier for the current session</doc:summary> | ||
490 | 190 | </doc:doc> | ||
491 | 191 | </arg> | ||
492 | 192 | <doc:doc> | ||
493 | 193 | <doc:description> | ||
494 | 194 | <doc:para>Returns the session ID that is associated with the specified cookie. | ||
495 | 195 | </doc:para> | ||
496 | 196 | </doc:description> | ||
497 | 197 | </doc:doc> | ||
498 | 198 | </method> | ||
499 | 199 | <method name="GetSessionForUnixProcess"> | ||
500 | 200 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
501 | 201 | <arg name="pid" direction="in" type="u"> | ||
502 | 202 | <doc:doc> | ||
503 | 203 | <doc:summary>The POSIX process ID</doc:summary> | ||
504 | 204 | </doc:doc> | ||
505 | 205 | </arg> | ||
506 | 206 | <arg name="ssid" direction="out" type="o"> | ||
507 | 207 | <doc:doc> | ||
508 | 208 | <doc:summary>The object identifier for the current session</doc:summary> | ||
509 | 209 | </doc:doc> | ||
510 | 210 | </arg> | ||
511 | 211 | <doc:doc> | ||
512 | 212 | <doc:description> | ||
513 | 213 | <doc:para>Attempts to determine the session ID for the specified | ||
514 | 214 | POSIX process ID (pid). | ||
515 | 215 | </doc:para> | ||
516 | 216 | </doc:description> | ||
517 | 217 | </doc:doc> | ||
518 | 218 | </method> | ||
519 | 219 | <method name="GetCurrentSession"> | ||
520 | 220 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
521 | 221 | <arg name="ssid" direction="out" type="o"> | ||
522 | 222 | <doc:doc> | ||
523 | 223 | <doc:summary>The object identifier for the current session</doc:summary> | ||
524 | 224 | </doc:doc> | ||
525 | 225 | </arg> | ||
526 | 226 | <doc:doc> | ||
527 | 227 | <doc:description> | ||
528 | 228 | <doc:para>Attempts to determine the session ID that the caller belongs to. | ||
529 | 229 | </doc:para> | ||
530 | 230 | <doc:para>See this example of using dbus-send: | ||
531 | 231 | <doc:example language="shell" title="shell example"><doc:code> | ||
532 | 232 | dbus-send --system --dest=org.freedesktop.ConsoleKit \ | ||
533 | 233 | --type=method_call --print-reply --reply-timeout=2000 \ | ||
534 | 234 | /org/freedesktop/ConsoleKit/Manager \ | ||
535 | 235 | org.freedesktop.ConsoleKit.Manager.GetCurrentSession | ||
536 | 236 | </doc:code></doc:example></doc:para> | ||
537 | 237 | </doc:description> | ||
538 | 238 | </doc:doc> | ||
539 | 239 | </method> | ||
540 | 240 | <method name="GetSessionsForUnixUser"> | ||
541 | 241 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
542 | 242 | <arg name="uid" direction="in" type="u"> | ||
543 | 243 | <doc:doc> | ||
544 | 244 | <doc:summary>POSIX User identification</doc:summary> | ||
545 | 245 | </doc:doc> | ||
546 | 246 | </arg> | ||
547 | 247 | <arg name="sessions" direction="out" type="ao"> | ||
548 | 248 | <doc:doc> | ||
549 | 249 | <doc:summary>an array of Session IDs</doc:summary> | ||
550 | 250 | </doc:doc> | ||
551 | 251 | </arg> | ||
552 | 252 | <doc:doc> | ||
553 | 253 | <doc:description> | ||
554 | 254 | <doc:para>This gets a list of all the <doc:ref type="interface" to="Session">Sessions</doc:ref> | ||
555 | 255 | that are currently open for the specified user.</doc:para> | ||
556 | 256 | <doc:para>Each Session ID is an D-Bus object path for the object that implements the | ||
557 | 257 | <doc:ref type="interface" to="Session">Session</doc:ref> interface.</doc:para> | ||
558 | 258 | </doc:description> | ||
559 | 259 | </doc:doc> | ||
560 | 260 | </method> | ||
561 | 261 | <method name="GetSessionsForUser"> | ||
562 | 262 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
563 | 263 | <arg name="uid" direction="in" type="u"> | ||
564 | 264 | <doc:doc> | ||
565 | 265 | <doc:summary>User identification</doc:summary> | ||
566 | 266 | </doc:doc> | ||
567 | 267 | </arg> | ||
568 | 268 | <arg name="sessions" direction="out" type="ao"> | ||
569 | 269 | <doc:doc> | ||
570 | 270 | <doc:summary>an array of Session IDs</doc:summary> | ||
571 | 271 | </doc:doc> | ||
572 | 272 | </arg> | ||
573 | 273 | <doc:doc> | ||
574 | 274 | <doc:description> | ||
575 | 275 | <doc:para>This gets a list of all the <doc:ref type="interface" to="Session">Sessions</doc:ref> | ||
576 | 276 | that are currently open for the specified user.</doc:para> | ||
577 | 277 | <doc:para>Each Session ID is an D-Bus object path for the object that implements the | ||
578 | 278 | <doc:ref type="interface" to="Session">Session</doc:ref> interface.</doc:para> | ||
579 | 279 | </doc:description> | ||
580 | 280 | <doc:deprecated version="0.1.3" instead="GetSessionsForUnixUser"/> | ||
581 | 281 | </doc:doc> | ||
582 | 282 | </method> | ||
583 | 283 | |||
584 | 284 | <method name="GetSystemIdleHint"> | ||
585 | 285 | <arg name="idle_hint" type="b" direction="out"> | ||
586 | 286 | <doc:doc> | ||
587 | 287 | <doc:summary>The value of the system-idle-hint</doc:summary> | ||
588 | 288 | </doc:doc> | ||
589 | 289 | </arg> | ||
590 | 290 | <doc:doc> | ||
591 | 291 | <doc:description> | ||
592 | 292 | <doc:para>Returns TRUE if the <doc:ref type="property" to="Session:idle-hint">idle-hint</doc:ref> | ||
593 | 293 | property of every open session is TRUE or if there are no open sessions. | ||
594 | 294 | </doc:para> | ||
595 | 295 | </doc:description> | ||
596 | 296 | </doc:doc> | ||
597 | 297 | </method> | ||
598 | 298 | <method name="GetSystemIdleSinceHint"> | ||
599 | 299 | <arg name="iso8601_datetime" type="s" direction="out"> | ||
600 | 300 | <doc:doc> | ||
601 | 301 | <doc:summary>An ISO 8601 format date-type string</doc:summary> | ||
602 | 302 | </doc:doc> | ||
603 | 303 | </arg> | ||
604 | 304 | <doc:doc> | ||
605 | 305 | <doc:description> | ||
606 | 306 | <doc:para>Returns an ISO 8601 date-time string that corresponds to | ||
607 | 307 | the time of the last change of the system-idle-hint. | ||
608 | 308 | </doc:para> | ||
609 | 309 | </doc:description> | ||
610 | 310 | </doc:doc> | ||
611 | 311 | </method> | ||
612 | 312 | |||
613 | 313 | <signal name="SeatAdded"> | ||
614 | 314 | <arg name="sid" type="o"> | ||
615 | 315 | <doc:doc> | ||
616 | 316 | <doc:summary>The Seat ID for the added seat</doc:summary> | ||
617 | 317 | </doc:doc> | ||
618 | 318 | </arg> | ||
619 | 319 | <doc:doc> | ||
620 | 320 | <doc:description> | ||
621 | 321 | <doc:para>Emitted when a Seat has been added to the system. | ||
622 | 322 | </doc:para> | ||
623 | 323 | </doc:description> | ||
624 | 324 | </doc:doc> | ||
625 | 325 | </signal> | ||
626 | 326 | <signal name="SeatRemoved"> | ||
627 | 327 | <arg name="sid" type="o"> | ||
628 | 328 | <doc:doc> | ||
629 | 329 | <doc:summary>The Seat ID for the removed seat</doc:summary> | ||
630 | 330 | </doc:doc> | ||
631 | 331 | </arg> | ||
632 | 332 | <doc:doc> | ||
633 | 333 | <doc:description> | ||
634 | 334 | <doc:para>Emitted when a Seat has been removed from the system. | ||
635 | 335 | </doc:para> | ||
636 | 336 | </doc:description> | ||
637 | 337 | </doc:doc> | ||
638 | 338 | </signal> | ||
639 | 339 | <signal name="SystemIdleHintChanged"> | ||
640 | 340 | <arg name="hint" type="b"> | ||
641 | 341 | <doc:doc> | ||
642 | 342 | <doc:summary>The value of the system-idle-hint</doc:summary> | ||
643 | 343 | </doc:doc> | ||
644 | 344 | </arg> | ||
645 | 345 | <doc:doc> | ||
646 | 346 | <doc:description> | ||
647 | 347 | <doc:para>Emitted when the value of the system-idle-hint has changed. | ||
648 | 348 | </doc:para> | ||
649 | 349 | </doc:description> | ||
650 | 350 | </doc:doc> | ||
651 | 351 | </signal> | ||
652 | 352 | </interface> | ||
653 | 353 | </node> | ||
654 | 354 | 0 | ||
655 | === removed file 'src/org.freedesktop.ConsoleKit.Seat.xml' | |||
656 | --- src/org.freedesktop.ConsoleKit.Seat.xml 2012-06-12 05:39:31 +0000 | |||
657 | +++ src/org.freedesktop.ConsoleKit.Seat.xml 1970-01-01 00:00:00 +0000 | |||
658 | @@ -1,164 +0,0 @@ | |||
659 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
660 | 2 | <node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
661 | 3 | |||
662 | 4 | <interface name="org.freedesktop.ConsoleKit.Seat"> | ||
663 | 5 | <doc:doc> | ||
664 | 6 | <doc:description> | ||
665 | 7 | <doc:para>A seat is a collection of sessions and a set of hardware (usually at | ||
666 | 8 | least a keyboard and mouse). Only one session may be active on a | ||
667 | 9 | seat at a time.</doc:para> | ||
668 | 10 | </doc:description> | ||
669 | 11 | </doc:doc> | ||
670 | 12 | |||
671 | 13 | <method name="GetId"> | ||
672 | 14 | <arg name="sid" direction="out" type="o"> | ||
673 | 15 | <doc:doc> | ||
674 | 16 | <doc:summary>Seat ID</doc:summary> | ||
675 | 17 | </doc:doc> | ||
676 | 18 | </arg> | ||
677 | 19 | <doc:doc> | ||
678 | 20 | <doc:description> | ||
679 | 21 | <doc:para>Returns the ID for Seat.</doc:para> | ||
680 | 22 | </doc:description> | ||
681 | 23 | </doc:doc> | ||
682 | 24 | </method> | ||
683 | 25 | |||
684 | 26 | <method name="GetSessions"> | ||
685 | 27 | <arg name="sessions" direction="out" type="ao"> | ||
686 | 28 | <doc:doc> | ||
687 | 29 | <doc:summary>an array of Session IDs</doc:summary> | ||
688 | 30 | </doc:doc> | ||
689 | 31 | </arg> | ||
690 | 32 | <doc:doc> | ||
691 | 33 | <doc:description> | ||
692 | 34 | <doc:para>This gets a list of all the <doc:ref type="interface" to="Session">Sessions</doc:ref> | ||
693 | 35 | that are currently attached to this seat.</doc:para> | ||
694 | 36 | <doc:para>Each Session ID is an D-Bus object path for the object that implements the | ||
695 | 37 | <doc:ref type="interface" to="Session">Session</doc:ref> interface.</doc:para> | ||
696 | 38 | </doc:description> | ||
697 | 39 | </doc:doc> | ||
698 | 40 | </method> | ||
699 | 41 | |||
700 | 42 | <method name="GetDevices"> | ||
701 | 43 | <arg name="devices" direction="out" type="a(ss)"> | ||
702 | 44 | <doc:doc> | ||
703 | 45 | <doc:summary>an array of devices</doc:summary> | ||
704 | 46 | </doc:doc> | ||
705 | 47 | </arg> | ||
706 | 48 | <doc:doc> | ||
707 | 49 | <doc:description> | ||
708 | 50 | <doc:para>This gets a list of all the devices | ||
709 | 51 | that are currently associated with this seat.</doc:para> | ||
710 | 52 | <doc:para>Each device is an D-Bus structure that represents | ||
711 | 53 | the device type and the device id. | ||
712 | 54 | </doc:para> | ||
713 | 55 | </doc:description> | ||
714 | 56 | </doc:doc> | ||
715 | 57 | </method> | ||
716 | 58 | |||
717 | 59 | <method name="GetActiveSession"> | ||
718 | 60 | <arg name="ssid" direction="out" type="o"> | ||
719 | 61 | <doc:doc> | ||
720 | 62 | <doc:summary>Session ID</doc:summary> | ||
721 | 63 | </doc:doc> | ||
722 | 64 | </arg> | ||
723 | 65 | <doc:doc> | ||
724 | 66 | <doc:description> | ||
725 | 67 | <doc:para>Gets the Session ID that is currently active on this Seat.</doc:para> | ||
726 | 68 | <doc:para>Returns NULL if there is no active session.</doc:para> | ||
727 | 69 | </doc:description> | ||
728 | 70 | </doc:doc> | ||
729 | 71 | </method> | ||
730 | 72 | |||
731 | 73 | <method name="CanActivateSessions"> | ||
732 | 74 | <arg name="can_activate" direction="out" type="b"> | ||
733 | 75 | <doc:doc> | ||
734 | 76 | <doc:summary>TRUE if seat supports session activation</doc:summary> | ||
735 | 77 | </doc:doc> | ||
736 | 78 | </arg> | ||
737 | 79 | <doc:doc> | ||
738 | 80 | <doc:description><doc:para>Used to determine whether the seat supports session activation.</doc:para> | ||
739 | 81 | </doc:description> | ||
740 | 82 | </doc:doc> | ||
741 | 83 | </method> | ||
742 | 84 | |||
743 | 85 | <method name="ActivateSession"> | ||
744 | 86 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
745 | 87 | <arg name="ssid" direction="in" type="o"> | ||
746 | 88 | <doc:doc> | ||
747 | 89 | <doc:summary>Session ID</doc:summary> | ||
748 | 90 | </doc:doc> | ||
749 | 91 | </arg> | ||
750 | 92 | <doc:doc> | ||
751 | 93 | <doc:description> | ||
752 | 94 | <doc:para>Attempt to activate the specified session. In most | ||
753 | 95 | cases, if successful, this will cause the session to | ||
754 | 96 | become visible and take control of the hardware that is | ||
755 | 97 | associated with this seat.</doc:para> | ||
756 | 98 | </doc:description> | ||
757 | 99 | <doc:seealso><doc:ref type="method" to="Session.Activate">Activate()</doc:ref></doc:seealso> | ||
758 | 100 | </doc:doc> | ||
759 | 101 | </method> | ||
760 | 102 | |||
761 | 103 | <signal name="ActiveSessionChanged"> | ||
762 | 104 | <arg name="ssid" type="s"> | ||
763 | 105 | <doc:doc> | ||
764 | 106 | <doc:summary>Session ID</doc:summary> | ||
765 | 107 | </doc:doc> | ||
766 | 108 | </arg> | ||
767 | 109 | <doc:doc> | ||
768 | 110 | <doc:description> | ||
769 | 111 | <doc:para>Emitted when the active session has changed.</doc:para> | ||
770 | 112 | </doc:description> | ||
771 | 113 | </doc:doc> | ||
772 | 114 | </signal> | ||
773 | 115 | <signal name="SessionAdded"> | ||
774 | 116 | <arg name="ssid" type="o"> | ||
775 | 117 | <doc:doc> | ||
776 | 118 | <doc:summary>Session ID</doc:summary> | ||
777 | 119 | </doc:doc> | ||
778 | 120 | </arg> | ||
779 | 121 | <doc:doc> | ||
780 | 122 | <doc:description> | ||
781 | 123 | <doc:para>Emitted when a session has been added to the seat.</doc:para> | ||
782 | 124 | </doc:description> | ||
783 | 125 | </doc:doc> | ||
784 | 126 | </signal> | ||
785 | 127 | <signal name="SessionRemoved"> | ||
786 | 128 | <arg name="ssid" type="o"> | ||
787 | 129 | <doc:doc> | ||
788 | 130 | <doc:summary>Session ID</doc:summary> | ||
789 | 131 | </doc:doc> | ||
790 | 132 | </arg> | ||
791 | 133 | <doc:doc> | ||
792 | 134 | <doc:description> | ||
793 | 135 | <doc:para>Emitted when a session has been removed from the seat.</doc:para> | ||
794 | 136 | </doc:description> | ||
795 | 137 | </doc:doc> | ||
796 | 138 | </signal> | ||
797 | 139 | <signal name="DeviceAdded"> | ||
798 | 140 | <arg name="device" type="(ss)"> | ||
799 | 141 | <doc:doc> | ||
800 | 142 | <doc:summary>Device structure</doc:summary> | ||
801 | 143 | </doc:doc> | ||
802 | 144 | </arg> | ||
803 | 145 | <doc:doc> | ||
804 | 146 | <doc:description> | ||
805 | 147 | <doc:para>Emitted when a device has been associated with the seat.</doc:para> | ||
806 | 148 | </doc:description> | ||
807 | 149 | </doc:doc> | ||
808 | 150 | </signal> | ||
809 | 151 | <signal name="DeviceRemoved"> | ||
810 | 152 | <arg name="device" type="(ss)"> | ||
811 | 153 | <doc:doc> | ||
812 | 154 | <doc:summary>Device structure</doc:summary> | ||
813 | 155 | </doc:doc> | ||
814 | 156 | </arg> | ||
815 | 157 | <doc:doc> | ||
816 | 158 | <doc:description> | ||
817 | 159 | <doc:para>Emitted when a device has been dissociated from the seat.</doc:para> | ||
818 | 160 | </doc:description> | ||
819 | 161 | </doc:doc> | ||
820 | 162 | </signal> | ||
821 | 163 | </interface> | ||
822 | 164 | </node> | ||
823 | 165 | 0 | ||
824 | === removed file 'src/org.freedesktop.ConsoleKit.Session.xml' | |||
825 | --- src/org.freedesktop.ConsoleKit.Session.xml 2011-08-17 20:53:51 +0000 | |||
826 | +++ src/org.freedesktop.ConsoleKit.Session.xml 1970-01-01 00:00:00 +0000 | |||
827 | @@ -1,435 +0,0 @@ | |||
828 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
829 | 2 | <node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
830 | 3 | |||
831 | 4 | <interface name="org.freedesktop.ConsoleKit.Session"> | ||
832 | 5 | <doc:doc> | ||
833 | 6 | <doc:description> | ||
834 | 7 | <doc:para>Session objects represent and store information | ||
835 | 8 | related to a user session. | ||
836 | 9 | </doc:para> | ||
837 | 10 | <doc:para>The properties associated with the Session | ||
838 | 11 | specifically refer to the properties of the "session leader". | ||
839 | 12 | </doc:para> | ||
840 | 13 | </doc:description> | ||
841 | 14 | </doc:doc> | ||
842 | 15 | <method name="GetId"> | ||
843 | 16 | <arg name="ssid" direction="out" type="o"> | ||
844 | 17 | <doc:doc> | ||
845 | 18 | <doc:summary>Session ID</doc:summary> | ||
846 | 19 | </doc:doc> | ||
847 | 20 | </arg> | ||
848 | 21 | <doc:doc> | ||
849 | 22 | <doc:description><doc:para>Returns the ID for Session.</doc:para> | ||
850 | 23 | </doc:description> | ||
851 | 24 | </doc:doc> | ||
852 | 25 | </method> | ||
853 | 26 | <method name="GetSeatId"> | ||
854 | 27 | <arg name="sid" direction="out" type="o"> | ||
855 | 28 | <doc:doc> | ||
856 | 29 | <doc:summary>Seat ID</doc:summary> | ||
857 | 30 | </doc:doc> | ||
858 | 31 | </arg> | ||
859 | 32 | <doc:doc> | ||
860 | 33 | <doc:description><doc:para>Returns the ID for the Seat the Session is | ||
861 | 34 | attached to.</doc:para> | ||
862 | 35 | </doc:description> | ||
863 | 36 | <doc:seealso><doc:ref type="interface" to="Seat">org.freedesktop.ConsoleKit.Seat</doc:ref></doc:seealso> | ||
864 | 37 | </doc:doc> | ||
865 | 38 | </method> | ||
866 | 39 | <method name="GetSessionType"> | ||
867 | 40 | <arg name="type" direction="out" type="s"> | ||
868 | 41 | <doc:doc> | ||
869 | 42 | <doc:summary>Session type</doc:summary> | ||
870 | 43 | </doc:doc> | ||
871 | 44 | </arg> | ||
872 | 45 | <doc:doc> | ||
873 | 46 | <doc:description> | ||
874 | 47 | <doc:para>Returns the type of the session.</doc:para> | ||
875 | 48 | <doc:para>Warning: we haven't yet defined the allowed values for this property. | ||
876 | 49 | It is probably best to avoid this until we do. | ||
877 | 50 | </doc:para> | ||
878 | 51 | </doc:description> | ||
879 | 52 | <doc:seealso><doc:ref type="property" to="Session:session-type">session-type</doc:ref></doc:seealso> | ||
880 | 53 | </doc:doc> | ||
881 | 54 | </method> | ||
882 | 55 | <method name="GetUser"> | ||
883 | 56 | <arg name="uid" direction="out" type="u"> | ||
884 | 57 | <doc:doc> | ||
885 | 58 | <doc:summary>User ID</doc:summary> | ||
886 | 59 | </doc:doc> | ||
887 | 60 | </arg> | ||
888 | 61 | <doc:doc> | ||
889 | 62 | <doc:description><doc:para>Returns the user that the session belongs to.</doc:para> | ||
890 | 63 | </doc:description> | ||
891 | 64 | <doc:deprecated version="0.1.3" instead="GetUnixUser"/> | ||
892 | 65 | <doc:seealso><doc:ref type="property" to="Session:user">user</doc:ref></doc:seealso> | ||
893 | 66 | </doc:doc> | ||
894 | 67 | </method> | ||
895 | 68 | <method name="GetUnixUser"> | ||
896 | 69 | <arg name="uid" direction="out" type="u"> | ||
897 | 70 | <doc:doc> | ||
898 | 71 | <doc:summary>POSIX User ID</doc:summary> | ||
899 | 72 | </doc:doc> | ||
900 | 73 | </arg> | ||
901 | 74 | <doc:doc> | ||
902 | 75 | <doc:description><doc:para>Returns the POSIX user ID that the session belongs to.</doc:para> | ||
903 | 76 | </doc:description> | ||
904 | 77 | <doc:seealso><doc:ref type="property" to="Session:unix-user">unix-user</doc:ref></doc:seealso> | ||
905 | 78 | </doc:doc> | ||
906 | 79 | </method> | ||
907 | 80 | <method name="GetX11Display"> | ||
908 | 81 | <arg name="display" direction="out" type="s"> | ||
909 | 82 | <doc:doc> | ||
910 | 83 | <doc:summary>The value of the X11 display</doc:summary> | ||
911 | 84 | </doc:doc> | ||
912 | 85 | </arg> | ||
913 | 86 | <doc:doc> | ||
914 | 87 | <doc:description><doc:para>Returns the value of the X11 DISPLAY for this session | ||
915 | 88 | if one is present.</doc:para> | ||
916 | 89 | </doc:description> | ||
917 | 90 | <doc:seealso><doc:ref type="property" to="Session:x11-display">x11-display</doc:ref></doc:seealso> | ||
918 | 91 | </doc:doc> | ||
919 | 92 | </method> | ||
920 | 93 | <method name="GetX11DisplayDevice"> | ||
921 | 94 | <arg name="x11_display_device" direction="out" type="s"> | ||
922 | 95 | <doc:doc> | ||
923 | 96 | <doc:summary>The value of the X11 display device</doc:summary> | ||
924 | 97 | </doc:doc> | ||
925 | 98 | </arg> | ||
926 | 99 | <doc:doc> | ||
927 | 100 | <doc:description><doc:para>Returns the value of the display device (aka TTY) that the | ||
928 | 101 | X11 display for the session is connected to. If there is no x11-display set then this value | ||
929 | 102 | is undefined.</doc:para> | ||
930 | 103 | </doc:description> | ||
931 | 104 | <doc:seealso><doc:ref type="property" to="Session:x11-display-device">x11-display-device</doc:ref></doc:seealso> | ||
932 | 105 | </doc:doc> | ||
933 | 106 | </method> | ||
934 | 107 | <method name="GetDisplayDevice"> | ||
935 | 108 | <arg name="display_device" direction="out" type="s"> | ||
936 | 109 | <doc:doc> | ||
937 | 110 | <doc:summary>The value of the display device</doc:summary> | ||
938 | 111 | </doc:doc> | ||
939 | 112 | </arg> | ||
940 | 113 | <doc:doc> | ||
941 | 114 | <doc:description><doc:para>Returns the value of the display device (aka TTY) that the | ||
942 | 115 | session is connected to.</doc:para> | ||
943 | 116 | </doc:description> | ||
944 | 117 | <doc:seealso><doc:ref type="property" to="Session:display-device">display-device</doc:ref></doc:seealso> | ||
945 | 118 | </doc:doc> | ||
946 | 119 | </method> | ||
947 | 120 | <method name="GetRemoteHostName"> | ||
948 | 121 | <arg name="remote_host_name" direction="out" type="s"> | ||
949 | 122 | <doc:doc> | ||
950 | 123 | <doc:summary>The remote host name</doc:summary> | ||
951 | 124 | </doc:doc> | ||
952 | 125 | </arg> | ||
953 | 126 | <doc:doc> | ||
954 | 127 | <doc:description><doc:para>Returns the value of the remote host name for the session. | ||
955 | 128 | </doc:para> | ||
956 | 129 | </doc:description> | ||
957 | 130 | <doc:seealso><doc:ref type="property" to="Session:remote-host-name">remote-host-name</doc:ref></doc:seealso> | ||
958 | 131 | </doc:doc> | ||
959 | 132 | </method> | ||
960 | 133 | <method name="GetLoginSessionId"> | ||
961 | 134 | <arg name="login_session_id" direction="out" type="s"> | ||
962 | 135 | <doc:doc> | ||
963 | 136 | <doc:summary>The value of the native system login session ID</doc:summary> | ||
964 | 137 | </doc:doc> | ||
965 | 138 | </arg> | ||
966 | 139 | <doc:doc> | ||
967 | 140 | <doc:description><doc:para>Returns the value of the login session ID that the | ||
968 | 141 | underlying system uses to enforce session boundaries. If there is no login session ID | ||
969 | 142 | set then this value is an empty string.</doc:para> | ||
970 | 143 | </doc:description> | ||
971 | 144 | </doc:doc> | ||
972 | 145 | </method> | ||
973 | 146 | <method name="IsActive"> | ||
974 | 147 | <arg name="active" direction="out" type="b"> | ||
975 | 148 | <doc:doc> | ||
976 | 149 | <doc:summary>TRUE if the session is active, otherwise FALSE</doc:summary> | ||
977 | 150 | </doc:doc> | ||
978 | 151 | </arg> | ||
979 | 152 | <doc:doc> | ||
980 | 153 | <doc:description><doc:para>Returns whether the session is active on the Seat that | ||
981 | 154 | it is attached to.</doc:para> | ||
982 | 155 | <doc:para>If the session is not attached to a seat this value is undefined. | ||
983 | 156 | </doc:para> | ||
984 | 157 | </doc:description> | ||
985 | 158 | <doc:seealso><doc:ref type="property" to="Session:active">active</doc:ref></doc:seealso> | ||
986 | 159 | </doc:doc> | ||
987 | 160 | </method> | ||
988 | 161 | <method name="IsLocal"> | ||
989 | 162 | <arg name="local" direction="out" type="b"> | ||
990 | 163 | <doc:doc> | ||
991 | 164 | <doc:summary>TRUE if the session is local, otherwise FALSE</doc:summary> | ||
992 | 165 | </doc:doc> | ||
993 | 166 | </arg> | ||
994 | 167 | <doc:doc> | ||
995 | 168 | <doc:description><doc:para>Returns whether the session is local</doc:para> | ||
996 | 169 | <doc:para>FIXME: we need to come up with a concrete definition for this value. | ||
997 | 170 | It was originally used as a way to identify XDMCP sessions that originate | ||
998 | 171 | from a remote system. | ||
999 | 172 | </doc:para> | ||
1000 | 173 | </doc:description> | ||
1001 | 174 | <doc:seealso><doc:ref type="property" to="Session:is-local">is-local</doc:ref></doc:seealso> | ||
1002 | 175 | </doc:doc> | ||
1003 | 176 | </method> | ||
1004 | 177 | <method name="GetCreationTime"> | ||
1005 | 178 | <arg name="iso8601_datetime" type="s" direction="out"> | ||
1006 | 179 | <doc:doc> | ||
1007 | 180 | <doc:summary>An ISO 8601 format date-type string</doc:summary> | ||
1008 | 181 | </doc:doc> | ||
1009 | 182 | </arg> | ||
1010 | 183 | <doc:doc> | ||
1011 | 184 | <doc:description> | ||
1012 | 185 | <doc:para>Returns an ISO 8601 date-time string that corresponds to | ||
1013 | 186 | the time that the session was opened. | ||
1014 | 187 | </doc:para> | ||
1015 | 188 | </doc:description> | ||
1016 | 189 | </doc:doc> | ||
1017 | 190 | </method> | ||
1018 | 191 | |||
1019 | 192 | <method name="Activate"> | ||
1020 | 193 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1021 | 194 | <doc:doc> | ||
1022 | 195 | <doc:description> | ||
1023 | 196 | <doc:para>Attempt to activate the this session. In most | ||
1024 | 197 | cases, if successful, this will cause the session to | ||
1025 | 198 | become visible and become active on the seat that it | ||
1026 | 199 | is attached to.</doc:para> | ||
1027 | 200 | </doc:description> | ||
1028 | 201 | <doc:seealso><doc:ref type="method" to="Seat.ActivateSession">Seat.ActivateSession()</doc:ref></doc:seealso> | ||
1029 | 202 | </doc:doc> | ||
1030 | 203 | </method> | ||
1031 | 204 | <method name="Lock"> | ||
1032 | 205 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1033 | 206 | <doc:doc> | ||
1034 | 207 | <doc:description> | ||
1035 | 208 | <doc:para>This will cause a <doc:ref type="signal" to="Session::Lock">Lock</doc:ref> | ||
1036 | 209 | signal to be emitted for this session. | ||
1037 | 210 | </doc:para> | ||
1038 | 211 | </doc:description> | ||
1039 | 212 | <doc:permission>This method is restricted to privileged users by D-Bus policy.</doc:permission> | ||
1040 | 213 | <doc:seealso><doc:ref type="signal" to="Session::Lock">Lock signal</doc:ref></doc:seealso> | ||
1041 | 214 | </doc:doc> | ||
1042 | 215 | </method> | ||
1043 | 216 | <method name="Unlock"> | ||
1044 | 217 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1045 | 218 | <doc:doc> | ||
1046 | 219 | <doc:description> | ||
1047 | 220 | <doc:para>This will cause an <doc:ref type="signal" to="Session::Unlock">Unlock</doc:ref> | ||
1048 | 221 | signal to be emitted for this session. | ||
1049 | 222 | </doc:para> | ||
1050 | 223 | <doc:para>This can be used by login managers to unlock a session before it is | ||
1051 | 224 | re-activated during fast-user-switching. | ||
1052 | 225 | </doc:para> | ||
1053 | 226 | </doc:description> | ||
1054 | 227 | <doc:permission>This method is restricted to privileged users by D-Bus policy.</doc:permission> | ||
1055 | 228 | <doc:seealso><doc:ref type="signal" to="Session::Unlock">Unlock signal</doc:ref></doc:seealso> | ||
1056 | 229 | </doc:doc> | ||
1057 | 230 | </method> | ||
1058 | 231 | |||
1059 | 232 | <method name="GetIdleHint"> | ||
1060 | 233 | <arg name="idle_hint" type="b" direction="out"> | ||
1061 | 234 | <doc:doc> | ||
1062 | 235 | <doc:summary>The value of the idle-hint</doc:summary> | ||
1063 | 236 | </doc:doc> | ||
1064 | 237 | </arg> | ||
1065 | 238 | <doc:doc> | ||
1066 | 239 | <doc:description> | ||
1067 | 240 | <doc:para>Gets the value of the <doc:ref type="property" to="Session:idle-hint">idle-hint</doc:ref> | ||
1068 | 241 | property. | ||
1069 | 242 | </doc:para> | ||
1070 | 243 | </doc:description> | ||
1071 | 244 | <doc:seealso><doc:ref type="property" to="Session:idle-hint">idle-hint</doc:ref></doc:seealso> | ||
1072 | 245 | </doc:doc> | ||
1073 | 246 | </method> | ||
1074 | 247 | <method name="GetIdleSinceHint"> | ||
1075 | 248 | <arg name="iso8601_datetime" type="s" direction="out"> | ||
1076 | 249 | <doc:doc> | ||
1077 | 250 | <doc:summary>An ISO 8601 format date-type string</doc:summary> | ||
1078 | 251 | </doc:doc> | ||
1079 | 252 | </arg> | ||
1080 | 253 | <doc:doc> | ||
1081 | 254 | <doc:description> | ||
1082 | 255 | <doc:para>Returns an ISO 8601 date-time string that corresponds to | ||
1083 | 256 | the time of the last change of the idle-hint. | ||
1084 | 257 | </doc:para> | ||
1085 | 258 | </doc:description> | ||
1086 | 259 | </doc:doc> | ||
1087 | 260 | </method> | ||
1088 | 261 | <method name="SetIdleHint"> | ||
1089 | 262 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1090 | 263 | <arg name="idle_hint" type="b" direction="in"> | ||
1091 | 264 | <doc:doc> | ||
1092 | 265 | <doc:summary>boolean value to set the idle-hint to</doc:summary> | ||
1093 | 266 | </doc:doc> | ||
1094 | 267 | </arg> | ||
1095 | 268 | <doc:doc> | ||
1096 | 269 | <doc:description> | ||
1097 | 270 | <doc:para>This may be used by the session to indicate that | ||
1098 | 271 | it is idle. | ||
1099 | 272 | </doc:para> | ||
1100 | 273 | <doc:para>Use of this method is restricted to the user | ||
1101 | 274 | that owns the session.</doc:para> | ||
1102 | 275 | </doc:description> | ||
1103 | 276 | </doc:doc> | ||
1104 | 277 | </method> | ||
1105 | 278 | |||
1106 | 279 | <signal name="ActiveChanged"> | ||
1107 | 280 | <arg name="is_active" type="b"> | ||
1108 | 281 | <doc:doc> | ||
1109 | 282 | <doc:summary>TRUE if the session is active, otherwise FALSE</doc:summary> | ||
1110 | 283 | </doc:doc> | ||
1111 | 284 | </arg> | ||
1112 | 285 | <doc:doc> | ||
1113 | 286 | <doc:description> | ||
1114 | 287 | <doc:para>Emitted when the active property has changed.</doc:para> | ||
1115 | 288 | </doc:description> | ||
1116 | 289 | </doc:doc> | ||
1117 | 290 | </signal> | ||
1118 | 291 | <signal name="IdleHintChanged"> | ||
1119 | 292 | <arg name="hint" type="b"> | ||
1120 | 293 | <doc:doc> | ||
1121 | 294 | <doc:summary>the new value of idle-hint</doc:summary> | ||
1122 | 295 | </doc:doc> | ||
1123 | 296 | </arg> | ||
1124 | 297 | <doc:doc> | ||
1125 | 298 | <doc:description> | ||
1126 | 299 | <doc:para>Emitted when the idle-hint property has changed.</doc:para> | ||
1127 | 300 | </doc:description> | ||
1128 | 301 | </doc:doc> | ||
1129 | 302 | </signal> | ||
1130 | 303 | <signal name="Lock"> | ||
1131 | 304 | <doc:doc> | ||
1132 | 305 | <doc:description> | ||
1133 | 306 | <doc:para>Emitted in response to a call to the <doc:ref type="method" to="Session.Lock">Lock()</doc:ref> method.</doc:para> | ||
1134 | 307 | <doc:para>It is intended that the screensaver for the session should lock the screen in response to this signal.</doc:para> | ||
1135 | 308 | </doc:description> | ||
1136 | 309 | </doc:doc> | ||
1137 | 310 | </signal> | ||
1138 | 311 | <signal name="Unlock"> | ||
1139 | 312 | <doc:doc> | ||
1140 | 313 | <doc:description> | ||
1141 | 314 | <doc:para>Emitted in response to a call to the <doc:ref type="method" to="Session.Unlock">Unlock()</doc:ref> method.</doc:para> | ||
1142 | 315 | <doc:para>It is intended that the screensaver for the session should unlock the screen in response to this signal.</doc:para> | ||
1143 | 316 | </doc:description> | ||
1144 | 317 | </doc:doc> | ||
1145 | 318 | </signal> | ||
1146 | 319 | |||
1147 | 320 | <property name="unix-user" type="u" access="readwrite"> | ||
1148 | 321 | <doc:doc> | ||
1149 | 322 | <doc:description> | ||
1150 | 323 | <doc:para>The user assigned to the session.</doc:para> | ||
1151 | 324 | </doc:description> | ||
1152 | 325 | </doc:doc> | ||
1153 | 326 | </property> | ||
1154 | 327 | <property name="user" type="u" access="readwrite"> | ||
1155 | 328 | <doc:doc> | ||
1156 | 329 | <doc:description> | ||
1157 | 330 | <doc:para>The user assigned to the session.</doc:para> | ||
1158 | 331 | </doc:description> | ||
1159 | 332 | <doc:deprecated version="0.1.3" instead="unix-user"/> | ||
1160 | 333 | </doc:doc> | ||
1161 | 334 | </property> | ||
1162 | 335 | <property name="session-type" type="s" access="readwrite"> | ||
1163 | 336 | <doc:doc> | ||
1164 | 337 | <doc:description> | ||
1165 | 338 | <doc:para>The type of the session.</doc:para> | ||
1166 | 339 | <doc:para>Warning: we haven't yet defined the allowed values for this property. | ||
1167 | 340 | It is probably best to avoid this until we do. | ||
1168 | 341 | </doc:para> | ||
1169 | 342 | </doc:description> | ||
1170 | 343 | </doc:doc> | ||
1171 | 344 | </property> | ||
1172 | 345 | <property name="remote-host-name" type="s" access="readwrite"> | ||
1173 | 346 | <doc:doc> | ||
1174 | 347 | <doc:description> | ||
1175 | 348 | <doc:para>The remote host name for the session. | ||
1176 | 349 | </doc:para> | ||
1177 | 350 | <doc:para>This will be set in situations where the session is | ||
1178 | 351 | opened and controlled from a remote system. | ||
1179 | 352 | </doc:para> | ||
1180 | 353 | <doc:para>For example, this value will be set when the | ||
1181 | 354 | session is created from an SSH or XDMCP connection. | ||
1182 | 355 | </doc:para> | ||
1183 | 356 | </doc:description> | ||
1184 | 357 | </doc:doc> | ||
1185 | 358 | </property> | ||
1186 | 359 | <property name="display-device" type="s" access="readwrite"> | ||
1187 | 360 | <doc:doc> | ||
1188 | 361 | <doc:description> | ||
1189 | 362 | <doc:para>The display device (aka TTY) that the | ||
1190 | 363 | session is connected to. | ||
1191 | 364 | </doc:para> | ||
1192 | 365 | </doc:description> | ||
1193 | 366 | </doc:doc> | ||
1194 | 367 | </property> | ||
1195 | 368 | <property name="x11-display" type="s" access="readwrite"> | ||
1196 | 369 | <doc:doc> | ||
1197 | 370 | <doc:description> | ||
1198 | 371 | <doc:para>Value of the X11 DISPLAY for this session | ||
1199 | 372 | if one is present. | ||
1200 | 373 | </doc:para> | ||
1201 | 374 | </doc:description> | ||
1202 | 375 | </doc:doc> | ||
1203 | 376 | </property> | ||
1204 | 377 | <property name="x11-display-device" type="s" access="readwrite"> | ||
1205 | 378 | <doc:doc> | ||
1206 | 379 | <doc:description> | ||
1207 | 380 | <doc:para> | ||
1208 | 381 | The display device (aka TTY) that the X11 display for the | ||
1209 | 382 | session is connected to. If there is no x11-display set then | ||
1210 | 383 | this value is undefined. | ||
1211 | 384 | </doc:para> | ||
1212 | 385 | </doc:description> | ||
1213 | 386 | </doc:doc> | ||
1214 | 387 | </property> | ||
1215 | 388 | <property name="active" type="b" access="readwrite"> | ||
1216 | 389 | <doc:doc> | ||
1217 | 390 | <doc:description> | ||
1218 | 391 | <doc:para> | ||
1219 | 392 | Whether the session is active on the Seat that | ||
1220 | 393 | it is attached to.</doc:para> | ||
1221 | 394 | <doc:para>If the session is not attached to a seat this value is undefined. | ||
1222 | 395 | </doc:para> | ||
1223 | 396 | </doc:description> | ||
1224 | 397 | </doc:doc> | ||
1225 | 398 | </property> | ||
1226 | 399 | <property name="is-local" type="b" access="readwrite"> | ||
1227 | 400 | <doc:doc> | ||
1228 | 401 | <doc:description> | ||
1229 | 402 | <doc:para> | ||
1230 | 403 | Whether the session is local</doc:para> | ||
1231 | 404 | <doc:para>FIXME: we need to come up with a concrete definition for this value. | ||
1232 | 405 | It was originally used as a way to identify XDMCP sessions that originate | ||
1233 | 406 | from a remote system. | ||
1234 | 407 | </doc:para> | ||
1235 | 408 | </doc:description> | ||
1236 | 409 | </doc:doc> | ||
1237 | 410 | </property> | ||
1238 | 411 | <property name="idle-hint" type="b" access="readwrite"> | ||
1239 | 412 | <doc:doc> | ||
1240 | 413 | <doc:description> | ||
1241 | 414 | <doc:para> | ||
1242 | 415 | This is a hint used to indicate that the session may be idle. | ||
1243 | 416 | </doc:para> | ||
1244 | 417 | <doc:para> | ||
1245 | 418 | For sessions with a <doc:ref type="property" to="Session:x11-display">x11-display</doc:ref> set (ie. graphical | ||
1246 | 419 | sessions), it is up to each session to delegate the | ||
1247 | 420 | responsibility for updating this value. Typically, the | ||
1248 | 421 | screensaver will set this. | ||
1249 | 422 | </doc:para> | ||
1250 | 423 | <doc:para>However, for non-graphical sessions with a <doc:ref type="property" to="Session:display-device">display-device</doc:ref> set | ||
1251 | 424 | the Session object itself will periodically update this value based | ||
1252 | 425 | on the activity detected on the display-device itself. | ||
1253 | 426 | </doc:para> | ||
1254 | 427 | <doc:para> | ||
1255 | 428 | This should not be considered authoritative. | ||
1256 | 429 | </doc:para> | ||
1257 | 430 | </doc:description> | ||
1258 | 431 | </doc:doc> | ||
1259 | 432 | </property> | ||
1260 | 433 | |||
1261 | 434 | </interface> | ||
1262 | 435 | </node> | ||
1263 | 436 | 0 | ||
1264 | === added file 'src/org.freedesktop.login1.Manager.xml' | |||
1265 | --- src/org.freedesktop.login1.Manager.xml 1970-01-01 00:00:00 +0000 | |||
1266 | +++ src/org.freedesktop.login1.Manager.xml 2013-04-22 12:49:38 +0000 | |||
1267 | @@ -0,0 +1,199 @@ | |||
1268 | 1 | <?xml version="1.0"?> | ||
1269 | 2 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
1270 | 3 | <node> | ||
1271 | 4 | <interface name="org.freedesktop.login1.Manager"> | ||
1272 | 5 | <method name="GetSession"> | ||
1273 | 6 | <arg name="id" type="s" direction="in"/> | ||
1274 | 7 | <arg name="session" type="o" direction="out"/> | ||
1275 | 8 | </method> | ||
1276 | 9 | <method name="GetSessionByPID"> | ||
1277 | 10 | <arg name="pid" type="u" direction="in"/> | ||
1278 | 11 | <arg name="session" type="o" direction="out"/> | ||
1279 | 12 | </method> | ||
1280 | 13 | <method name="GetUser"> | ||
1281 | 14 | <arg name="uid" type="u" direction="in"/> | ||
1282 | 15 | <arg name="user" type="o" direction="out"/> | ||
1283 | 16 | </method> | ||
1284 | 17 | <method name="GetSeat"> | ||
1285 | 18 | <arg name="id" type="s" direction="in"/> | ||
1286 | 19 | <arg name="seat" type="o" direction="out"/> | ||
1287 | 20 | </method> | ||
1288 | 21 | <method name="ListSessions"> | ||
1289 | 22 | <arg name="sessions" type="a(susso)" direction="out"/> | ||
1290 | 23 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="SessionObjectList"/> | ||
1291 | 24 | </method> | ||
1292 | 25 | <method name="ListUsers"> | ||
1293 | 26 | <arg name="users" type="a(uso)" direction="out"/> | ||
1294 | 27 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="UintStringPathList"/> | ||
1295 | 28 | </method> | ||
1296 | 29 | <method name="ListSeats"> | ||
1297 | 30 | <arg name="seats" type="a(so)" direction="out"/> | ||
1298 | 31 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="StringPathList"/> | ||
1299 | 32 | </method> | ||
1300 | 33 | <method name="CreateSession"> | ||
1301 | 34 | <arg name="uid" type="u" direction="in"/> | ||
1302 | 35 | <arg name="leader" type="u" direction="in"/> | ||
1303 | 36 | <arg name="sevice" type="s" direction="in"/> | ||
1304 | 37 | <arg name="type" type="s" direction="in"/> | ||
1305 | 38 | <arg name="klass" type="s" direction="in"/> | ||
1306 | 39 | <arg name="seat" type="s" direction="in"/> | ||
1307 | 40 | <arg name="vtnr" type="u" direction="in"/> | ||
1308 | 41 | <arg name="tty" type="s" direction="in"/> | ||
1309 | 42 | <arg name="display" type="s" direction="in"/> | ||
1310 | 43 | <arg name="remote" type="b" direction="in"/> | ||
1311 | 44 | <arg name="remote_user" type="s" direction="in"/> | ||
1312 | 45 | <arg name="remote_host" type="s" direction="in"/> | ||
1313 | 46 | <arg name="controllers" type="as" direction="in"/> | ||
1314 | 47 | <arg name="reset_controllers" type="as" direction="in"/> | ||
1315 | 48 | <arg name="kill_processes" type="b" direction="in"/> | ||
1316 | 49 | <arg name="id" type="s" direction="out"/> | ||
1317 | 50 | <arg name="path" type="o" direction="out"/> | ||
1318 | 51 | <arg name="runtime_path" type="o" direction="out"/> | ||
1319 | 52 | <arg name="fd" type="h" direction="out"/> | ||
1320 | 53 | <arg name="seat" type="s" direction="out"/> | ||
1321 | 54 | <arg name="vtnr" type="u" direction="out"/> | ||
1322 | 55 | <arg name="existing" type="b" direction="out"/> | ||
1323 | 56 | </method> | ||
1324 | 57 | <method name="ReleaseSession"> | ||
1325 | 58 | <arg name="id" type="s" direction="in"/> | ||
1326 | 59 | </method> | ||
1327 | 60 | <method name="ActivateSession"> | ||
1328 | 61 | <arg name="id" type="s" direction="in"/> | ||
1329 | 62 | </method> | ||
1330 | 63 | <method name="ActivateSessionOnSeat"> | ||
1331 | 64 | <arg name="id" type="s" direction="in"/> | ||
1332 | 65 | <arg name="seat" type="s" direction="in"/> | ||
1333 | 66 | </method> | ||
1334 | 67 | <method name="LockSession"> | ||
1335 | 68 | <arg name="id" type="s" direction="in"/> | ||
1336 | 69 | </method> | ||
1337 | 70 | <method name="UnlockSession"> | ||
1338 | 71 | <arg name="id" type="s" direction="in"/> | ||
1339 | 72 | </method> | ||
1340 | 73 | <method name="LockSessions"/> | ||
1341 | 74 | <method name="KillSession"> | ||
1342 | 75 | <arg name="id" type="s" direction="in"/> | ||
1343 | 76 | <arg name="who" type="s" direction="in"/> | ||
1344 | 77 | <arg name="signal" type="s" direction="in"/> | ||
1345 | 78 | </method> | ||
1346 | 79 | <method name="KillUser"> | ||
1347 | 80 | <arg name="uid" type="u" direction="in"/> | ||
1348 | 81 | <arg name="signal" type="s" direction="in"/> | ||
1349 | 82 | </method> | ||
1350 | 83 | <method name="TerminateSession"> | ||
1351 | 84 | <arg name="id" type="s" direction="in"/> | ||
1352 | 85 | </method> | ||
1353 | 86 | <method name="TerminateUser"> | ||
1354 | 87 | <arg name="uid" type="u" direction="in"/> | ||
1355 | 88 | </method> | ||
1356 | 89 | <method name="TerminateSeat"> | ||
1357 | 90 | <arg name="id" type="s" direction="in"/> | ||
1358 | 91 | </method> | ||
1359 | 92 | <method name="SetUserLinger"> | ||
1360 | 93 | <arg name="uid" type="u" direction="in"/> | ||
1361 | 94 | <arg name="b" type="b" direction="in"/> | ||
1362 | 95 | <arg name="interactive" type="b" direction="in"/> | ||
1363 | 96 | </method> | ||
1364 | 97 | <method name="AttachDevice"> | ||
1365 | 98 | <arg name="seat" type="s" direction="in"/> | ||
1366 | 99 | <arg name="sysfs" type="s" direction="in"/> | ||
1367 | 100 | <arg name="interactive" type="b" direction="in"/> | ||
1368 | 101 | </method> | ||
1369 | 102 | <method name="FlushDevices"> | ||
1370 | 103 | <arg name="interactive" type="b" direction="in"/> | ||
1371 | 104 | </method> | ||
1372 | 105 | <method name="PowerOff"> | ||
1373 | 106 | <arg name="interactive" type="b" direction="in"/> | ||
1374 | 107 | </method> | ||
1375 | 108 | <method name="Reboot"> | ||
1376 | 109 | <arg name="interactive" type="b" direction="in"/> | ||
1377 | 110 | </method> | ||
1378 | 111 | <method name="Suspend"> | ||
1379 | 112 | <arg name="interactive" type="b" direction="in"/> | ||
1380 | 113 | </method> | ||
1381 | 114 | <method name="Hibernate"> | ||
1382 | 115 | <arg name="interactive" type="b" direction="in"/> | ||
1383 | 116 | </method> | ||
1384 | 117 | <method name="HybridSleep"> | ||
1385 | 118 | <arg name="interactive" type="b" direction="in"/> | ||
1386 | 119 | </method> | ||
1387 | 120 | <method name="CanPowerOff"> | ||
1388 | 121 | <arg name="result" type="s" direction="out"/> | ||
1389 | 122 | </method> | ||
1390 | 123 | <method name="CanReboot"> | ||
1391 | 124 | <arg name="result" type="s" direction="out"/> | ||
1392 | 125 | </method> | ||
1393 | 126 | <method name="CanSuspend"> | ||
1394 | 127 | <arg name="result" type="s" direction="out"/> | ||
1395 | 128 | </method> | ||
1396 | 129 | <method name="CanHibernate"> | ||
1397 | 130 | <arg name="result" type="s" direction="out"/> | ||
1398 | 131 | </method> | ||
1399 | 132 | <method name="CanHybridSleep"> | ||
1400 | 133 | <arg name="result" type="s" direction="out"/> | ||
1401 | 134 | </method> | ||
1402 | 135 | <method name="Inhibit"> | ||
1403 | 136 | <arg name="what" type="s" direction="in"/> | ||
1404 | 137 | <arg name="who" type="s" direction="in"/> | ||
1405 | 138 | <arg name="why" type="s" direction="in"/> | ||
1406 | 139 | <arg name="mode" type="s" direction="in"/> | ||
1407 | 140 | <arg name="fd" type="h" direction="out"/> | ||
1408 | 141 | </method> | ||
1409 | 142 | <method name="ListInhibitors"> | ||
1410 | 143 | <arg name="inhibitors" type="a(ssssuu)" direction="out"/> | ||
1411 | 144 | <!-- TODO: Create an appropriate type --> | ||
1412 | 145 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantList"/> | ||
1413 | 146 | </method> | ||
1414 | 147 | <signal name="SessionNew"> | ||
1415 | 148 | <arg name="id" type="s"/> | ||
1416 | 149 | <arg name="path" type="o"/> | ||
1417 | 150 | </signal> | ||
1418 | 151 | <signal name="SessionRemoved"> | ||
1419 | 152 | <arg name="id" type="s"/> | ||
1420 | 153 | <arg name="path" type="o"/> | ||
1421 | 154 | </signal> | ||
1422 | 155 | <signal name="UserNew"> | ||
1423 | 156 | <arg name="uid" type="u"/> | ||
1424 | 157 | <arg name="path" type="o"/> | ||
1425 | 158 | </signal> | ||
1426 | 159 | <signal name="UserRemoved"> | ||
1427 | 160 | <arg name="uid" type="u"/> | ||
1428 | 161 | <arg name="path" type="o"/> | ||
1429 | 162 | </signal> | ||
1430 | 163 | <signal name="SeatNew"> | ||
1431 | 164 | <arg name="id" type="s"/> | ||
1432 | 165 | <arg name="path" type="o"/> | ||
1433 | 166 | </signal> | ||
1434 | 167 | <signal name="SeatRemoved"> | ||
1435 | 168 | <arg name="id" type="s"/> | ||
1436 | 169 | <arg name="path" type="o"/> | ||
1437 | 170 | </signal> | ||
1438 | 171 | <signal name="PrepareForShutdown"> | ||
1439 | 172 | <arg name="active" type="b"/> | ||
1440 | 173 | </signal> | ||
1441 | 174 | <signal name="PrepareForSleep"> | ||
1442 | 175 | <arg name="active" type="b"/> | ||
1443 | 176 | </signal> | ||
1444 | 177 | <property name="ControlGroupHierarchy" type="s" access="read"/> | ||
1445 | 178 | <property name="Controllers" type="as" access="read"/> | ||
1446 | 179 | <property name="ResetControllers" type="as" access="read"/> | ||
1447 | 180 | <property name="NAutoVTs" type="u" access="read"/> | ||
1448 | 181 | <property name="KillOnlyUsers" type="as" access="read"/> | ||
1449 | 182 | <property name="KillExcludeUsers" type="as" access="read"/> | ||
1450 | 183 | <property name="KillUserProcesses" type="b" access="read"/> | ||
1451 | 184 | <property name="IdleHint" type="b" access="read"/> | ||
1452 | 185 | <property name="IdleSinceHint" type="t" access="read"/> | ||
1453 | 186 | <property name="IdleSinceHintMonotonic" type="t" access="read"/> | ||
1454 | 187 | <property name="BlockInhibited" type="s" access="read"/> | ||
1455 | 188 | <property name="DelayInhibited" type="s" access="read"/> | ||
1456 | 189 | <property name="InhibitDelayMaxUSec" type="t" access="read"/> | ||
1457 | 190 | <property name="HandlePowerKey" type="s" access="read"/> | ||
1458 | 191 | <property name="HandleSuspendKey" type="s" access="read"/> | ||
1459 | 192 | <property name="HandleHibernateKey" type="s" access="read"/> | ||
1460 | 193 | <property name="HandleLidSwitch" type="s" access="read"/> | ||
1461 | 194 | <property name="IdleAction" type="s" access="read"/> | ||
1462 | 195 | <property name="IdleActionUSec" type="t" access="read"/> | ||
1463 | 196 | <property name="PreparingForShutdown" type="b" access="read"/> | ||
1464 | 197 | <property name="PreparingForSleep" type="b" access="read"/> | ||
1465 | 198 | </interface> | ||
1466 | 199 | </node> | ||
1467 | 0 | 200 | ||
1468 | === added file 'src/org.freedesktop.login1.Seat.xml' | |||
1469 | --- src/org.freedesktop.login1.Seat.xml 1970-01-01 00:00:00 +0000 | |||
1470 | +++ src/org.freedesktop.login1.Seat.xml 2013-04-22 12:49:38 +0000 | |||
1471 | @@ -0,0 +1,21 @@ | |||
1472 | 1 | <?xml version="1.0"?> | ||
1473 | 2 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
1474 | 3 | <node> | ||
1475 | 4 | <interface name="org.freedesktop.login1.Seat"> | ||
1476 | 5 | <method name="Terminate"/> | ||
1477 | 6 | <method name="ActivateSession"> | ||
1478 | 7 | <arg name="id" type="s"/> | ||
1479 | 8 | </method> | ||
1480 | 9 | <property name="Id" type="s" access="read"/> | ||
1481 | 10 | <property name="ActiveSession" type="so" access="read"/> | ||
1482 | 11 | <property name="CanMultiSession" type="b" access="read"/> | ||
1483 | 12 | <property name="CanTTY" type="b" access="read"/> | ||
1484 | 13 | <property name="CanGraphical" type="b" access="read"/> | ||
1485 | 14 | <property name="Sessions" type="a(so)" access="read"> | ||
1486 | 15 | <annotation name="org.qtproject.QtDBus.QtTypeName" value="StringPathList"/> | ||
1487 | 16 | </property> | ||
1488 | 17 | <property name="IdleHint" type="b" access="read"/> | ||
1489 | 18 | <property name="IdleSinceHint" type="t" access="read"/> | ||
1490 | 19 | <property name="IdleSinceHintMonotonic" type="t" access="read"/> | ||
1491 | 20 | </interface> | ||
1492 | 21 | </node> | ||
1493 | 0 | 22 | ||
1494 | === added file 'src/org.freedesktop.login1.Session.xml' | |||
1495 | --- src/org.freedesktop.login1.Session.xml 1970-01-01 00:00:00 +0000 | |||
1496 | +++ src/org.freedesktop.login1.Session.xml 2013-04-22 12:49:38 +0000 | |||
1497 | @@ -0,0 +1,49 @@ | |||
1498 | 1 | <?xml version="1.0"?> | ||
1499 | 2 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
1500 | 3 | <node> | ||
1501 | 4 | <interface name="org.freedesktop.login1.Session"> | ||
1502 | 5 | <method name="Terminate"/> | ||
1503 | 6 | <method name="Activate"/> | ||
1504 | 7 | <method name="Lock"/> | ||
1505 | 8 | <method name="Unlock"/> | ||
1506 | 9 | <method name="SetIdleHint"> | ||
1507 | 10 | <arg name="b" direction="in" type="b"/> | ||
1508 | 11 | </method> | ||
1509 | 12 | <method name="Kill"> | ||
1510 | 13 | <arg name="who" direction="in" type="s"/> | ||
1511 | 14 | <arg name="signal" direction="in" type="s"/> | ||
1512 | 15 | </method> | ||
1513 | 16 | <signal name="Lock"/> | ||
1514 | 17 | <signal name="Unlock"/> | ||
1515 | 18 | <property name="Id" type="s" access="read"/> | ||
1516 | 19 | <property name="User" type="(uo)" access="read"> | ||
1517 | 20 | <annotation name="org.qtproject.QtDBus.QtTypeName" value="UintPath"/> | ||
1518 | 21 | </property> | ||
1519 | 22 | <property name="Name" type="s" access="read"/> | ||
1520 | 23 | <property name="Timestamp" type="t" access="read"/> | ||
1521 | 24 | <property name="TimestampMonotonic" type="t" access="read"/> | ||
1522 | 25 | <property name="DefaultControlGroup" type="s" access="read"/> | ||
1523 | 26 | <property name="VTNr" type="u" access="read"/> | ||
1524 | 27 | <property name="Seat" type="(so)" access="read"> | ||
1525 | 28 | <annotation name="org.qtproject.QtDBus.QtTypeName" value="StringPath"/> | ||
1526 | 29 | </property> | ||
1527 | 30 | <property name="TTY" type="s" access="read"/> | ||
1528 | 31 | <property name="Display" type="s" access="read"/> | ||
1529 | 32 | <property name="Remote" type="b" access="read"/> | ||
1530 | 33 | <property name="RemoteHost" type="s" access="read"/> | ||
1531 | 34 | <property name="RemoteUser" type="s" access="read"/> | ||
1532 | 35 | <property name="Service" type="s" access="read"/> | ||
1533 | 36 | <property name="Leader" type="u" access="read"/> | ||
1534 | 37 | <property name="Audit" type="u" access="read"/> | ||
1535 | 38 | <property name="Type" type="s" access="read"/> | ||
1536 | 39 | <property name="Class" type="s" access="read"/> | ||
1537 | 40 | <property name="Active" type="b" access="read"/> | ||
1538 | 41 | <property name="State" type="s" access="read"/> | ||
1539 | 42 | <property name="Controllers" type="as" access="read"/> | ||
1540 | 43 | <property name="ResetControllers" type="as" access="read"/> | ||
1541 | 44 | <property name="KillProcesses" type="b" access="read"/> | ||
1542 | 45 | <property name="IdleHint" type="b" access="read"/> | ||
1543 | 46 | <property name="IdleSinceHint" type="t" access="read"/> | ||
1544 | 47 | <property name="IdleSinceHintMonotonic" type="t" access="read"/> | ||
1545 | 48 | </interface> | ||
1546 | 49 | </node> | ||
1547 | 0 | 50 | ||
1548 | === added file 'src/org.freedesktop.login1.User.xml' | |||
1549 | --- src/org.freedesktop.login1.User.xml 1970-01-01 00:00:00 +0000 | |||
1550 | +++ src/org.freedesktop.login1.User.xml 2013-04-22 12:49:38 +0000 | |||
1551 | @@ -0,0 +1,56 @@ | |||
1552 | 1 | <?xml version="1.0"?> | ||
1553 | 2 | <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
1554 | 3 | <node> | ||
1555 | 4 | <interface name="org.freedesktop.login1.User"> | ||
1556 | 5 | <method name="Terminate"/> | ||
1557 | 6 | <method name="Kill"> | ||
1558 | 7 | <arg name="signal" direction="in" type="s"/> | ||
1559 | 8 | </method> | ||
1560 | 9 | <property name="UID" type="u" access="read"/> | ||
1561 | 10 | <property name="GID" type="u" access="read"/> | ||
1562 | 11 | <property name="Name" type="s" access="read"/> | ||
1563 | 12 | <property name="Timestamp" type="t" access="read"/> | ||
1564 | 13 | <property name="TimestampMonotonic" type="t" access="read"/> | ||
1565 | 14 | <property name="RuntimePath" type="s" access="read"/> | ||
1566 | 15 | <property name="DefaultControlGroup" type="s" access="read"/> | ||
1567 | 16 | <property name="Service" type="s" access="read"/> | ||
1568 | 17 | <property name="Display" type="(so)" access="read"/> | ||
1569 | 18 | <property name="State" type="s" access="read"/> | ||
1570 | 19 | <property name="Sessions" type="a(so)" access="read"/> | ||
1571 | 20 | <property name="IdleHint" type="b" access="read"/> | ||
1572 | 21 | <property name="IdleSinceHint" type="t" access="read"/> | ||
1573 | 22 | <property name="IdleSinceHintMonotonic" type="t" access="read"/> | ||
1574 | 23 | </interface> | ||
1575 | 24 | <interface name="org.freedesktop.DBus.Properties"> | ||
1576 | 25 | <method name="Get"> | ||
1577 | 26 | <arg name="interface" direction="in" type="s"/> | ||
1578 | 27 | <arg name="property" direction="in" type="s"/> | ||
1579 | 28 | <arg name="value" direction="out" type="v"/> | ||
1580 | 29 | </method> | ||
1581 | 30 | <method name="GetAll"> | ||
1582 | 31 | <arg name="interface" direction="in" type="s"/> | ||
1583 | 32 | <arg name="properties" direction="out" type="a{sv}"/> | ||
1584 | 33 | </method> | ||
1585 | 34 | <method name="Set"> | ||
1586 | 35 | <arg name="interface" direction="in" type="s"/> | ||
1587 | 36 | <arg name="property" direction="in" type="s"/> | ||
1588 | 37 | <arg name="value" direction="in" type="v"/> | ||
1589 | 38 | </method> | ||
1590 | 39 | <signal name="PropertiesChanged"> | ||
1591 | 40 | <arg type="s" name="interface"/> | ||
1592 | 41 | <arg type="a{sv}" name="changed_properties"/> | ||
1593 | 42 | <arg type="as" name="invalidated_properties"/> | ||
1594 | 43 | </signal> | ||
1595 | 44 | </interface> | ||
1596 | 45 | <interface name="org.freedesktop.DBus.Peer"> | ||
1597 | 46 | <method name="Ping"/> | ||
1598 | 47 | <method name="GetMachineId"> | ||
1599 | 48 | <arg type="s" name="machine_uuid" direction="out"/> | ||
1600 | 49 | </method> | ||
1601 | 50 | </interface> | ||
1602 | 51 | <interface name="org.freedesktop.DBus.Introspectable"> | ||
1603 | 52 | <method name="Introspect"> | ||
1604 | 53 | <arg name="data" type="s" direction="out"/> | ||
1605 | 54 | </method> | ||
1606 | 55 | </interface> | ||
1607 | 56 | </node> | ||
1608 | 0 | 57 | ||
1609 | === modified file 'src/session-menu-mgr.c' | |||
1610 | --- src/session-menu-mgr.c 2013-03-06 15:29:26 +0000 | |||
1611 | +++ src/session-menu-mgr.c 2013-04-22 12:49:38 +0000 | |||
1612 | @@ -29,7 +29,7 @@ | |||
1613 | 29 | #include <libdbusmenu-glib/client.h> | 29 | #include <libdbusmenu-glib/client.h> |
1614 | 30 | #include <libdbusmenu-gtk/menuitem.h> | 30 | #include <libdbusmenu-gtk/menuitem.h> |
1615 | 31 | 31 | ||
1617 | 32 | #include "dbus-upower.h" | 32 | #include "dbus-login1-manager.h" |
1618 | 33 | #include "session-menu-mgr.h" | 33 | #include "session-menu-mgr.h" |
1619 | 34 | #include "shared-names.h" | 34 | #include "shared-names.h" |
1620 | 35 | #include "users-service-dbus.h" | 35 | #include "users-service-dbus.h" |
1621 | @@ -37,8 +37,8 @@ | |||
1622 | 37 | 37 | ||
1623 | 38 | #define DEBUG_SHOW_ALL FALSE | 38 | #define DEBUG_SHOW_ALL FALSE |
1624 | 39 | 39 | ||
1627 | 40 | #define UPOWER_ADDRESS "org.freedesktop.UPower" | 40 | #define LOGIN1_MANAGER_ADDRESS "org.freedesktop.login1" |
1628 | 41 | #define UPOWER_PATH "/org/freedesktop/UPower" | 41 | #define LOGIN1_MANAGER_PATH "/org/freedesktop/login1" |
1629 | 42 | 42 | ||
1630 | 43 | #define CMD_HELP "yelp" | 43 | #define CMD_HELP "yelp" |
1631 | 44 | #define CMD_INFO "gnome-control-center info" | 44 | #define CMD_INFO "gnome-control-center info" |
1632 | @@ -77,7 +77,7 @@ | |||
1633 | 77 | * This is a pretty straightforward class: it creates the menumodel | 77 | * This is a pretty straightforward class: it creates the menumodel |
1634 | 78 | * and listens for events that can affect the model's properties. | 78 | * and listens for events that can affect the model's properties. |
1635 | 79 | * | 79 | * |
1637 | 80 | * Simple event sources, such as GSettings and a UPower DBus proxy, | 80 | * Simple event sources, such as GSettings and a logind DBus proxy, |
1638 | 81 | * are handled here. More involved event sources are delegated to the | 81 | * are handled here. More involved event sources are delegated to the |
1639 | 82 | * UsersServiceDBus facade class. | 82 | * UsersServiceDBus facade class. |
1640 | 83 | */ | 83 | */ |
1641 | @@ -104,18 +104,16 @@ | |||
1642 | 104 | GSettings * indicator_settings; | 104 | GSettings * indicator_settings; |
1643 | 105 | GSettings * keybinding_settings; | 105 | GSettings * keybinding_settings; |
1644 | 106 | 106 | ||
1646 | 107 | /* cached settings taken from the upower proxy */ | 107 | /* cached settings taken from the logind proxy */ |
1647 | 108 | gboolean can_hibernate; | 108 | gboolean can_hibernate; |
1648 | 109 | gboolean can_suspend; | 109 | gboolean can_suspend; |
1649 | 110 | gboolean allow_hibernate; | ||
1650 | 111 | gboolean allow_suspend; | ||
1651 | 112 | 110 | ||
1652 | 113 | gboolean shell_mode; | 111 | gboolean shell_mode; |
1653 | 114 | gboolean greeter_mode; | 112 | gboolean greeter_mode; |
1654 | 115 | 113 | ||
1655 | 116 | guint shell_name_watcher; | 114 | guint shell_name_watcher; |
1656 | 117 | GCancellable * cancellable; | 115 | GCancellable * cancellable; |
1658 | 118 | DBusUPower * upower_proxy; | 116 | Login1Manager * login1_manager_proxy; |
1659 | 119 | SessionDbus * session_dbus; | 117 | SessionDbus * session_dbus; |
1660 | 120 | UsersServiceDbus * users_dbus_facade; | 118 | UsersServiceDbus * users_dbus_facade; |
1661 | 121 | OnlineAccountsMgr * online_accounts_mgr; | 119 | OnlineAccountsMgr * online_accounts_mgr; |
1662 | @@ -123,7 +121,7 @@ | |||
1663 | 123 | 121 | ||
1664 | 124 | static SwitcherMode get_switcher_mode (SessionMenuMgr *); | 122 | static SwitcherMode get_switcher_mode (SessionMenuMgr *); |
1665 | 125 | 123 | ||
1667 | 126 | static void init_upower_proxy (SessionMenuMgr *); | 124 | static void init_login1_proxy (SessionMenuMgr *); |
1668 | 127 | static void init_shell_watcher (SessionMenuMgr *); | 125 | static void init_shell_watcher (SessionMenuMgr *); |
1669 | 128 | 126 | ||
1670 | 129 | static void update_screensaver_shortcut (SessionMenuMgr *); | 127 | static void update_screensaver_shortcut (SessionMenuMgr *); |
1671 | @@ -203,7 +201,7 @@ | |||
1672 | 203 | g_signal_connect (mgr->users_dbus_facade, "guest-logged-in-changed", | 201 | g_signal_connect (mgr->users_dbus_facade, "guest-logged-in-changed", |
1673 | 204 | G_CALLBACK(on_guest_logged_in_changed), mgr); | 202 | G_CALLBACK(on_guest_logged_in_changed), mgr); |
1674 | 205 | 203 | ||
1676 | 206 | init_upower_proxy (mgr); | 204 | init_login1_proxy (mgr); |
1677 | 207 | init_shell_watcher (mgr); | 205 | init_shell_watcher (mgr); |
1678 | 208 | 206 | ||
1679 | 209 | /* Online accounts menu item */ | 207 | /* Online accounts menu item */ |
1680 | @@ -224,7 +222,7 @@ | |||
1681 | 224 | g_clear_object (&mgr->indicator_settings); | 222 | g_clear_object (&mgr->indicator_settings); |
1682 | 225 | g_clear_object (&mgr->lockdown_settings); | 223 | g_clear_object (&mgr->lockdown_settings); |
1683 | 226 | g_clear_object (&mgr->keybinding_settings); | 224 | g_clear_object (&mgr->keybinding_settings); |
1685 | 227 | g_clear_object (&mgr->upower_proxy); | 225 | g_clear_object (&mgr->login1_manager_proxy); |
1686 | 228 | g_clear_object (&mgr->users_dbus_facade); | 226 | g_clear_object (&mgr->users_dbus_facade); |
1687 | 229 | g_clear_object (&mgr->top_mi); | 227 | g_clear_object (&mgr->top_mi); |
1688 | 230 | g_clear_object (&mgr->session_dbus); | 228 | g_clear_object (&mgr->session_dbus); |
1689 | @@ -248,97 +246,67 @@ | |||
1690 | 248 | object_class->dispose = session_menu_mgr_dispose; | 246 | object_class->dispose = session_menu_mgr_dispose; |
1691 | 249 | } | 247 | } |
1692 | 250 | 248 | ||
1706 | 251 | /*** | 249 | static gboolean |
1707 | 252 | **** UPower Proxy: | 250 | can_perform_operation (gchar * permission) |
1695 | 253 | **** | ||
1696 | 254 | **** 1. While bootstrapping, we invoke the AllowSuspend and AllowHibernate | ||
1697 | 255 | **** methods to find out whether or not those features are allowed. | ||
1698 | 256 | **** 2. While bootstrapping, we get the CanSuspend and CanHibernate properties | ||
1699 | 257 | **** and also listen for property changes. | ||
1700 | 258 | **** 3. These four values are used to set suspend and hibernate's visibility. | ||
1701 | 259 | **** | ||
1702 | 260 | ***/ | ||
1703 | 261 | |||
1704 | 262 | static void | ||
1705 | 263 | on_upower_properties_changed (SessionMenuMgr * mgr) | ||
1708 | 264 | { | 251 | { |
1736 | 265 | gboolean need_refresh = FALSE; | 252 | return g_strcmp0 ("yes", permission) == 0; |
1710 | 266 | |||
1711 | 267 | if (mgr->upower_proxy != NULL) | ||
1712 | 268 | { | ||
1713 | 269 | gboolean b; | ||
1714 | 270 | |||
1715 | 271 | /* suspend */ | ||
1716 | 272 | b = dbus_upower_get_can_suspend (mgr->upower_proxy); | ||
1717 | 273 | if (mgr->can_suspend != b) | ||
1718 | 274 | { | ||
1719 | 275 | mgr->can_suspend = b; | ||
1720 | 276 | need_refresh = TRUE; | ||
1721 | 277 | } | ||
1722 | 278 | |||
1723 | 279 | /* hibernate */ | ||
1724 | 280 | b = dbus_upower_get_can_hibernate (mgr->upower_proxy); | ||
1725 | 281 | if (mgr->can_hibernate != b) | ||
1726 | 282 | { | ||
1727 | 283 | mgr->can_hibernate = b; | ||
1728 | 284 | need_refresh = TRUE; | ||
1729 | 285 | } | ||
1730 | 286 | } | ||
1731 | 287 | |||
1732 | 288 | if (need_refresh) | ||
1733 | 289 | { | ||
1734 | 290 | update_session_menuitems (mgr); | ||
1735 | 291 | } | ||
1737 | 292 | } | 253 | } |
1738 | 293 | 254 | ||
1739 | 294 | static void | 255 | static void |
1741 | 295 | init_upower_proxy (SessionMenuMgr * mgr) | 256 | init_login1_proxy (SessionMenuMgr * mgr) |
1742 | 296 | { | 257 | { |
1743 | 297 | /* default values */ | 258 | /* default values */ |
1744 | 298 | mgr->can_suspend = TRUE; | 259 | mgr->can_suspend = TRUE; |
1745 | 299 | mgr->can_hibernate = TRUE; | 260 | mgr->can_hibernate = TRUE; |
1748 | 300 | mgr->allow_suspend = TRUE; | 261 | |
1749 | 301 | mgr->allow_hibernate = TRUE; | 262 | gchar * can_suspend; |
1750 | 263 | gchar * can_hibernate; | ||
1751 | 302 | 264 | ||
1752 | 303 | mgr->cancellable = g_cancellable_new (); | 265 | mgr->cancellable = g_cancellable_new (); |
1753 | 304 | 266 | ||
1754 | 305 | GError * error = NULL; | 267 | GError * error = NULL; |
1756 | 306 | mgr->upower_proxy = dbus_upower_proxy_new_for_bus_sync ( | 268 | mgr->login1_manager_proxy = login1_manager_proxy_new_for_bus_sync ( |
1757 | 307 | G_BUS_TYPE_SYSTEM, | 269 | G_BUS_TYPE_SYSTEM, |
1758 | 308 | G_DBUS_PROXY_FLAGS_NONE, | 270 | G_DBUS_PROXY_FLAGS_NONE, |
1761 | 309 | UPOWER_ADDRESS, | 271 | LOGIN1_MANAGER_ADDRESS, |
1762 | 310 | UPOWER_PATH, | 272 | LOGIN1_MANAGER_PATH, |
1763 | 311 | NULL, | 273 | NULL, |
1764 | 312 | &error); | 274 | &error); |
1765 | 313 | if (error != NULL) | 275 | if (error != NULL) |
1766 | 314 | { | 276 | { |
1768 | 315 | g_warning ("Error creating upower proxy: %s", error->message); | 277 | g_warning ("Error creating logind proxy: %s", error->message); |
1769 | 316 | g_clear_error (&error); | 278 | g_clear_error (&error); |
1770 | 317 | } | 279 | } |
1771 | 318 | else | 280 | else |
1772 | 319 | { | 281 | { |
1795 | 320 | dbus_upower_call_suspend_allowed_sync (mgr->upower_proxy, | 282 | login1_manager_call_can_suspend_sync (mgr->login1_manager_proxy, |
1796 | 321 | &mgr->allow_suspend, | 283 | &can_suspend, |
1797 | 322 | NULL, | 284 | NULL, |
1798 | 323 | &error); | 285 | &error); |
1799 | 324 | if (error != NULL) | 286 | if (error != NULL) |
1800 | 325 | { | 287 | { |
1801 | 326 | g_warning ("%s: %s", G_STRFUNC, error->message); | 288 | g_warning ("%s: %s", G_STRFUNC, error->message); |
1802 | 327 | g_clear_error (&error); | 289 | g_clear_error (&error); |
1803 | 328 | } | 290 | } |
1804 | 329 | 291 | else | |
1805 | 330 | dbus_upower_call_hibernate_allowed_sync (mgr->upower_proxy, | 292 | { |
1806 | 331 | &mgr->allow_hibernate, | 293 | mgr->can_suspend = can_perform_operation (can_suspend); |
1807 | 332 | NULL, | 294 | } |
1808 | 333 | &error); | 295 | |
1809 | 334 | if (error != NULL) | 296 | login1_manager_call_can_hibernate_sync (mgr->login1_manager_proxy, |
1810 | 335 | { | 297 | &can_hibernate, |
1811 | 336 | g_warning ("%s: %s", G_STRFUNC, error->message); | 298 | NULL, |
1812 | 337 | g_clear_error (&error); | 299 | &error); |
1813 | 338 | } | 300 | if (error != NULL) |
1814 | 339 | 301 | { | |
1815 | 340 | g_signal_connect_swapped (mgr->upower_proxy, "changed", | 302 | g_warning ("%s: %s", G_STRFUNC, error->message); |
1816 | 341 | G_CALLBACK(on_upower_properties_changed), mgr); | 303 | g_clear_error (&error); |
1817 | 304 | } | ||
1818 | 305 | else | ||
1819 | 306 | { | ||
1820 | 307 | mgr->can_hibernate = can_perform_operation (can_hibernate); | ||
1821 | 308 | } | ||
1822 | 309 | |||
1823 | 342 | } | 310 | } |
1824 | 343 | } | 311 | } |
1825 | 344 | 312 | ||
1826 | @@ -505,13 +473,9 @@ | |||
1827 | 505 | && !g_settings_get_boolean (s, "suppress-logout-menuitem"); | 473 | && !g_settings_get_boolean (s, "suppress-logout-menuitem"); |
1828 | 506 | mi_set_visible (mgr->logout_mi, v); | 474 | mi_set_visible (mgr->logout_mi, v); |
1829 | 507 | 475 | ||
1833 | 508 | v = mgr->can_suspend | 476 | mi_set_visible (mgr->suspend_mi, mgr->can_suspend); |
1831 | 509 | && mgr->allow_suspend; | ||
1832 | 510 | mi_set_visible (mgr->suspend_mi, v); | ||
1834 | 511 | 477 | ||
1838 | 512 | v = mgr->can_hibernate | 478 | mi_set_visible (mgr->hibernate_mi, mgr->can_hibernate); |
1836 | 513 | && mgr->allow_hibernate; | ||
1837 | 514 | mi_set_visible (mgr->hibernate_mi, v); | ||
1839 | 515 | 479 | ||
1840 | 516 | v = (!mgr->shell_mode || g_settings_get_boolean (s, "suppress-logout-restart-shutdown")) | 480 | v = (!mgr->shell_mode || g_settings_get_boolean (s, "suppress-logout-restart-shutdown")) |
1841 | 517 | && (HAVE_RESTART_CMD || mgr->shell_mode) | 481 | && (HAVE_RESTART_CMD || mgr->shell_mode) |
1842 | @@ -878,10 +842,6 @@ | |||
1843 | 878 | } | 842 | } |
1844 | 879 | 843 | ||
1845 | 880 | /* maybe the seat doesn't support activation */ | 844 | /* maybe the seat doesn't support activation */ |
1846 | 881 | if (!users_service_dbus_can_activate_session (mgr->users_dbus_facade)) | ||
1847 | 882 | { | ||
1848 | 883 | return FALSE; | ||
1849 | 884 | } | ||
1850 | 885 | 845 | ||
1851 | 886 | return TRUE; | 846 | return TRUE; |
1852 | 887 | } | 847 | } |
1853 | @@ -1147,9 +1107,10 @@ | |||
1854 | 1147 | { | 1107 | { |
1855 | 1148 | GError * error = NULL; | 1108 | GError * error = NULL; |
1856 | 1149 | 1109 | ||
1860 | 1150 | dbus_upower_call_suspend_sync (mgr->upower_proxy, | 1110 | login1_manager_call_suspend_sync (mgr->login1_manager_proxy, |
1861 | 1151 | mgr->cancellable, | 1111 | TRUE, |
1862 | 1152 | &error); | 1112 | mgr->cancellable, |
1863 | 1113 | &error); | ||
1864 | 1153 | 1114 | ||
1865 | 1154 | if (error != NULL) | 1115 | if (error != NULL) |
1866 | 1155 | { | 1116 | { |
1867 | @@ -1163,9 +1124,10 @@ | |||
1868 | 1163 | { | 1124 | { |
1869 | 1164 | GError * error = NULL; | 1125 | GError * error = NULL; |
1870 | 1165 | 1126 | ||
1874 | 1166 | dbus_upower_call_hibernate_sync (mgr->upower_proxy, | 1127 | login1_manager_call_hibernate_sync (mgr->login1_manager_proxy, |
1875 | 1167 | mgr->cancellable, | 1128 | TRUE, |
1876 | 1168 | &error); | 1129 | mgr->cancellable, |
1877 | 1130 | &error); | ||
1878 | 1169 | 1131 | ||
1879 | 1170 | if (error != NULL) | 1132 | if (error != NULL) |
1880 | 1171 | { | 1133 | { |
1881 | @@ -1350,10 +1312,6 @@ | |||
1882 | 1350 | update_user_menuitems (mgr); | 1312 | update_user_menuitems (mgr); |
1883 | 1351 | build_session_menuitems (mgr); | 1313 | build_session_menuitems (mgr); |
1884 | 1352 | 1314 | ||
1885 | 1353 | /* After we have the session menu items built we can look to | ||
1886 | 1354 | align them with UPower */ | ||
1887 | 1355 | on_upower_properties_changed (mgr); | ||
1888 | 1356 | |||
1889 | 1357 | return mgr; | 1315 | return mgr; |
1890 | 1358 | } | 1316 | } |
1891 | 1359 | 1317 | ||
1892 | 1360 | 1318 | ||
1893 | === removed file 'src/upower.xml' | |||
1894 | --- src/upower.xml 2012-06-12 05:39:31 +0000 | |||
1895 | +++ src/upower.xml 1970-01-01 00:00:00 +0000 | |||
1896 | @@ -1,309 +0,0 @@ | |||
1897 | 1 | <!DOCTYPE node PUBLIC | ||
1898 | 2 | "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
1899 | 3 | "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
1900 | 4 | <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
1901 | 5 | |||
1902 | 6 | <interface name="org.freedesktop.UPower"> | ||
1903 | 7 | <doc:doc> | ||
1904 | 8 | <doc:description> | ||
1905 | 9 | <doc:para> | ||
1906 | 10 | The DeviceKit-power service is available via the system message | ||
1907 | 11 | bus. To access the service, use | ||
1908 | 12 | the <doc:tt>org.freedesktop.UPower</doc:tt> interface on | ||
1909 | 13 | the <doc:tt>/org/freedesktop/UPower</doc:tt> object on | ||
1910 | 14 | the D-Bus system bus service with the well-known | ||
1911 | 15 | name <doc:tt>org.freedesktop.UPower</doc:tt>. | ||
1912 | 16 | </doc:para> | ||
1913 | 17 | <doc:para> | ||
1914 | 18 | <doc:example language="shell" title="simple example"> | ||
1915 | 19 | <doc:code> | ||
1916 | 20 | $ dbus-send --print-reply \ | ||
1917 | 21 | --system \ | ||
1918 | 22 | --dest=org.freedesktop.UPower \ | ||
1919 | 23 | /org/freedesktop/UPower \ | ||
1920 | 24 | org.freedesktop.UPower.EnumerateDevices | ||
1921 | 25 | |||
1922 | 26 | method return sender=:1.386 -> dest=:1.451 reply_serial=2 | ||
1923 | 27 | array [ | ||
1924 | 28 | object path "/org/freedesktop/UPower/devices/line_power_AC" | ||
1925 | 29 | object path "/org/freedesktop/UPower/devices/battery_BAT0" | ||
1926 | 30 | ] | ||
1927 | 31 | </doc:code> | ||
1928 | 32 | </doc:example> | ||
1929 | 33 | </doc:para> | ||
1930 | 34 | </doc:description> | ||
1931 | 35 | </doc:doc> | ||
1932 | 36 | |||
1933 | 37 | <!-- ************************************************************ --> | ||
1934 | 38 | |||
1935 | 39 | <method name="EnumerateDevices"> | ||
1936 | 40 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1937 | 41 | <arg name="devices" direction="out" type="ao"> | ||
1938 | 42 | <doc:doc><doc:summary>An array of object paths for devices.</doc:summary></doc:doc> | ||
1939 | 43 | </arg> | ||
1940 | 44 | |||
1941 | 45 | <doc:doc> | ||
1942 | 46 | <doc:description> | ||
1943 | 47 | <doc:para> | ||
1944 | 48 | Enumerate all power objects on the system. | ||
1945 | 49 | </doc:para> | ||
1946 | 50 | </doc:description> | ||
1947 | 51 | </doc:doc> | ||
1948 | 52 | </method> | ||
1949 | 53 | |||
1950 | 54 | <!-- ************************************************************ --> | ||
1951 | 55 | |||
1952 | 56 | <signal name="DeviceAdded"> | ||
1953 | 57 | <arg name="device" type="o"> | ||
1954 | 58 | <doc:doc><doc:summary>Object path of device that was added.</doc:summary></doc:doc> | ||
1955 | 59 | </arg> | ||
1956 | 60 | |||
1957 | 61 | <doc:doc> | ||
1958 | 62 | <doc:description> | ||
1959 | 63 | <doc:para> | ||
1960 | 64 | Emitted when a device is added. | ||
1961 | 65 | </doc:para> | ||
1962 | 66 | </doc:description> | ||
1963 | 67 | </doc:doc> | ||
1964 | 68 | </signal> | ||
1965 | 69 | |||
1966 | 70 | <!-- ************************************************************ --> | ||
1967 | 71 | |||
1968 | 72 | <signal name="DeviceRemoved"> | ||
1969 | 73 | <arg name="device" type="o"> | ||
1970 | 74 | <doc:doc><doc:summary>Object path of device that was removed.</doc:summary></doc:doc> | ||
1971 | 75 | </arg> | ||
1972 | 76 | |||
1973 | 77 | <doc:doc> | ||
1974 | 78 | <doc:description> | ||
1975 | 79 | <doc:para> | ||
1976 | 80 | Emitted when a device is removed. | ||
1977 | 81 | </doc:para> | ||
1978 | 82 | </doc:description> | ||
1979 | 83 | </doc:doc> | ||
1980 | 84 | </signal> | ||
1981 | 85 | |||
1982 | 86 | <!-- ************************************************************ --> | ||
1983 | 87 | |||
1984 | 88 | <signal name="DeviceChanged"> | ||
1985 | 89 | <arg name="device" type="s"> | ||
1986 | 90 | <doc:doc><doc:summary>Object path of device that was changed.</doc:summary></doc:doc> | ||
1987 | 91 | </arg> | ||
1988 | 92 | |||
1989 | 93 | <doc:doc> | ||
1990 | 94 | <doc:description> | ||
1991 | 95 | <doc:para> | ||
1992 | 96 | Emitted when a device changed. | ||
1993 | 97 | </doc:para> | ||
1994 | 98 | </doc:description> | ||
1995 | 99 | </doc:doc> | ||
1996 | 100 | </signal> | ||
1997 | 101 | |||
1998 | 102 | <!-- ************************************************************ --> | ||
1999 | 103 | |||
2000 | 104 | <signal name="Changed"> | ||
2001 | 105 | <doc:doc> | ||
2002 | 106 | <doc:description> | ||
2003 | 107 | <doc:para> | ||
2004 | 108 | Emitted when one or more properties on the object changes. | ||
2005 | 109 | </doc:para> | ||
2006 | 110 | </doc:description> | ||
2007 | 111 | </doc:doc> | ||
2008 | 112 | </signal> | ||
2009 | 113 | |||
2010 | 114 | <!-- ************************************************************ --> | ||
2011 | 115 | |||
2012 | 116 | <signal name="Sleeping"> | ||
2013 | 117 | <doc:doc> | ||
2014 | 118 | <doc:description> | ||
2015 | 119 | <doc:para> | ||
2016 | 120 | This signal is sent when the session is about to be suspended or | ||
2017 | 121 | hibernated. | ||
2018 | 122 | Session and system programs have one second to do anything required | ||
2019 | 123 | before the sleep action is taken (such as sending out Avahi or | ||
2020 | 124 | Jabber messages). | ||
2021 | 125 | </doc:para> | ||
2022 | 126 | </doc:description> | ||
2023 | 127 | </doc:doc> | ||
2024 | 128 | </signal> | ||
2025 | 129 | |||
2026 | 130 | <!-- ************************************************************ --> | ||
2027 | 131 | |||
2028 | 132 | <signal name="Resuming"> | ||
2029 | 133 | <doc:doc> | ||
2030 | 134 | <doc:description> | ||
2031 | 135 | <doc:para> | ||
2032 | 136 | This signal is sent when the session has just returned from | ||
2033 | 137 | Suspend() or Hibernate(). | ||
2034 | 138 | Session and system programs can then do anything required (such as | ||
2035 | 139 | sending out Avahi or Jabber messages). | ||
2036 | 140 | </doc:para> | ||
2037 | 141 | </doc:description> | ||
2038 | 142 | </doc:doc> | ||
2039 | 143 | </signal> | ||
2040 | 144 | |||
2041 | 145 | <!-- ************************************************************ --> | ||
2042 | 146 | |||
2043 | 147 | <method name="AboutToSleep"> | ||
2044 | 148 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2045 | 149 | <doc:doc> | ||
2046 | 150 | <doc:description> | ||
2047 | 151 | <doc:para> | ||
2048 | 152 | This method tells UPower that the Suspend() or Hibernate() method | ||
2049 | 153 | is about to be called. | ||
2050 | 154 | This allows UPower to emit the Suspending signal whilst | ||
2051 | 155 | session activities are happening that have to be done before the | ||
2052 | 156 | suspend process is started. | ||
2053 | 157 | </doc:para> | ||
2054 | 158 | <doc:para> | ||
2055 | 159 | This method would typically be called by the session power | ||
2056 | 160 | management daemon, before it locks the screen and waits for the | ||
2057 | 161 | screen to fade to black. | ||
2058 | 162 | The session power management component would then call Suspend() or | ||
2059 | 163 | Hibernate() when these syncronous tasks have completed. | ||
2060 | 164 | </doc:para> | ||
2061 | 165 | <doc:para> | ||
2062 | 166 | If this method is not called than nothing bad will happen and | ||
2063 | 167 | Suspend() or Hibernate() will block for the required second. | ||
2064 | 168 | </doc:para> | ||
2065 | 169 | </doc:description> | ||
2066 | 170 | </doc:doc> | ||
2067 | 171 | </method> | ||
2068 | 172 | |||
2069 | 173 | <!-- ************************************************************ --> | ||
2070 | 174 | |||
2071 | 175 | <method name="Suspend"> | ||
2072 | 176 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2073 | 177 | <doc:doc> | ||
2074 | 178 | <doc:description> | ||
2075 | 179 | <doc:para> | ||
2076 | 180 | Suspends the computer into a low power state. | ||
2077 | 181 | System state is not preserved if the power is lost. | ||
2078 | 182 | </doc:para> | ||
2079 | 183 | <doc:para> | ||
2080 | 184 | If AboutToRequestSleep() has not been called then UPower will send | ||
2081 | 185 | the Sleeping() signal and block for one second. | ||
2082 | 186 | </doc:para> | ||
2083 | 187 | <doc:para> | ||
2084 | 188 | If AboutToRequestSleep() has been called less than one second | ||
2085 | 189 | before this method is called then UPower will block for the | ||
2086 | 190 | remaining time to complete one second of delay. | ||
2087 | 191 | </doc:para> | ||
2088 | 192 | </doc:description> | ||
2089 | 193 | </doc:doc> | ||
2090 | 194 | </method> | ||
2091 | 195 | |||
2092 | 196 | <!-- ************************************************************ --> | ||
2093 | 197 | |||
2094 | 198 | <method name="SuspendAllowed"> | ||
2095 | 199 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2096 | 200 | <arg name="allowed" direction="out" type="b"> | ||
2097 | 201 | <doc:doc><doc:summary>TRUE if allowed, otherwise FALSE</doc:summary></doc:doc> | ||
2098 | 202 | </arg> | ||
2099 | 203 | <doc:doc> | ||
2100 | 204 | <doc:description> | ||
2101 | 205 | <doc:para> | ||
2102 | 206 | Check if the caller has (or can get) the PolicyKit privilege to call | ||
2103 | 207 | <doc:ref type="method" to="Power.Suspend">Suspend</doc:ref>. | ||
2104 | 208 | </doc:para> | ||
2105 | 209 | </doc:description> | ||
2106 | 210 | </doc:doc> | ||
2107 | 211 | </method> | ||
2108 | 212 | |||
2109 | 213 | <!-- ************************************************************ --> | ||
2110 | 214 | |||
2111 | 215 | <method name="Hibernate"> | ||
2112 | 216 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2113 | 217 | <doc:doc> | ||
2114 | 218 | <doc:description> | ||
2115 | 219 | <doc:para> | ||
2116 | 220 | Hibernates the computer into a low power state. | ||
2117 | 221 | System state is preserved if the power is lost. | ||
2118 | 222 | </doc:para> | ||
2119 | 223 | <doc:para> | ||
2120 | 224 | If AboutToRequestSleep() has not been called then UPower will send | ||
2121 | 225 | the Sleeping() signal and block for one second. | ||
2122 | 226 | </doc:para> | ||
2123 | 227 | <doc:para> | ||
2124 | 228 | If AboutToRequestSleep() has been called less than one second | ||
2125 | 229 | before this method is called then UPower will block for the | ||
2126 | 230 | remaining time to complete one second of delay. | ||
2127 | 231 | </doc:para> | ||
2128 | 232 | </doc:description> | ||
2129 | 233 | </doc:doc> | ||
2130 | 234 | </method> | ||
2131 | 235 | |||
2132 | 236 | <!-- ************************************************************ --> | ||
2133 | 237 | |||
2134 | 238 | <method name="HibernateAllowed"> | ||
2135 | 239 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2136 | 240 | <arg name="allowed" direction="out" type="b"> | ||
2137 | 241 | <doc:doc><doc:summary>TRUE if allowed, otherwise FALSE</doc:summary></doc:doc> | ||
2138 | 242 | </arg> | ||
2139 | 243 | <doc:doc> | ||
2140 | 244 | <doc:description> | ||
2141 | 245 | <doc:para> | ||
2142 | 246 | Check if the caller has (or can get) the PolicyKit privilege to call | ||
2143 | 247 | <doc:ref type="method" to="Power.Hibernate">Hibernate</doc:ref>. | ||
2144 | 248 | </doc:para> | ||
2145 | 249 | </doc:description> | ||
2146 | 250 | </doc:doc> | ||
2147 | 251 | </method> | ||
2148 | 252 | |||
2149 | 253 | <!-- ************************************************************ --> | ||
2150 | 254 | |||
2151 | 255 | <property name="DaemonVersion" type="s" access="read"> | ||
2152 | 256 | <doc:doc><doc:description><doc:para> | ||
2153 | 257 | Version of the running daemon, e.g. <doc:tt>002</doc:tt>. | ||
2154 | 258 | </doc:para></doc:description></doc:doc> | ||
2155 | 259 | </property> | ||
2156 | 260 | |||
2157 | 261 | <property name="CanSuspend" type="b" access="read"> | ||
2158 | 262 | <doc:doc><doc:description><doc:para> | ||
2159 | 263 | Whether the system is able to suspend. | ||
2160 | 264 | </doc:para></doc:description></doc:doc> | ||
2161 | 265 | </property> | ||
2162 | 266 | |||
2163 | 267 | <property name="CanHibernate" type="b" access="read"> | ||
2164 | 268 | <doc:doc><doc:description><doc:para> | ||
2165 | 269 | Whether the system is able to hibernate. | ||
2166 | 270 | </doc:para></doc:description></doc:doc> | ||
2167 | 271 | </property> | ||
2168 | 272 | |||
2169 | 273 | <property name="OnBattery" type="b" access="read"> | ||
2170 | 274 | <doc:doc><doc:description><doc:para> | ||
2171 | 275 | Indicates whether the system is running on battery power. | ||
2172 | 276 | This property is provided for convenience. | ||
2173 | 277 | </doc:para></doc:description></doc:doc> | ||
2174 | 278 | </property> | ||
2175 | 279 | |||
2176 | 280 | <property name="OnLowBattery" type="b" access="read"> | ||
2177 | 281 | <doc:doc><doc:description><doc:para> | ||
2178 | 282 | Indicates whether the system is running on battery power and if the battery is critically low. | ||
2179 | 283 | This property is provided for convenience. | ||
2180 | 284 | </doc:para></doc:description></doc:doc> | ||
2181 | 285 | </property> | ||
2182 | 286 | |||
2183 | 287 | <property name="LidIsClosed" type="b" access="read"> | ||
2184 | 288 | <doc:doc> | ||
2185 | 289 | <doc:description> | ||
2186 | 290 | <doc:para> | ||
2187 | 291 | Indicates if the laptop lid is closed where the display cannot be seen. | ||
2188 | 292 | </doc:para> | ||
2189 | 293 | </doc:description> | ||
2190 | 294 | </doc:doc> | ||
2191 | 295 | </property> | ||
2192 | 296 | |||
2193 | 297 | <property name="LidIsPresent" type="b" access="read"> | ||
2194 | 298 | <doc:doc> | ||
2195 | 299 | <doc:description> | ||
2196 | 300 | <doc:para> | ||
2197 | 301 | If the system has a lid device. | ||
2198 | 302 | </doc:para> | ||
2199 | 303 | </doc:description> | ||
2200 | 304 | </doc:doc> | ||
2201 | 305 | </property> | ||
2202 | 306 | |||
2203 | 307 | </interface> | ||
2204 | 308 | |||
2205 | 309 | </node> | ||
2206 | 310 | 0 | ||
2207 | === modified file 'src/users-service-dbus.c' | |||
2208 | --- src/users-service-dbus.c 2012-11-12 23:30:15 +0000 | |||
2209 | +++ src/users-service-dbus.c 2013-04-22 12:49:38 +0000 | |||
2210 | @@ -30,16 +30,15 @@ | |||
2211 | 30 | #include <pwd.h> /* getpwuid() */ | 30 | #include <pwd.h> /* getpwuid() */ |
2212 | 31 | 31 | ||
2213 | 32 | #include "dbus-accounts.h" | 32 | #include "dbus-accounts.h" |
2217 | 33 | #include "dbus-consolekit-manager.h" | 33 | #include "dbus-login1-manager.h" |
2218 | 34 | #include "dbus-consolekit-seat.h" | 34 | #include "dbus-login1-session.h" |
2219 | 35 | #include "dbus-consolekit-session.h" | 35 | #include "dbus-login1-user.h" |
2220 | 36 | #include "dbus-display-manager.h" | 36 | #include "dbus-display-manager.h" |
2221 | 37 | #include "dbus-user.h" | 37 | #include "dbus-user.h" |
2222 | 38 | #include "shared-names.h" | 38 | #include "shared-names.h" |
2223 | 39 | #include "users-service-dbus.h" | 39 | #include "users-service-dbus.h" |
2224 | 40 | 40 | ||
2227 | 41 | #define CK_ADDR "org.freedesktop.ConsoleKit" | 41 | #define LOGIND_ADDR "org.freedesktop.login1" |
2226 | 42 | #define CK_SESSION_IFACE "org.freedesktop.ConsoleKit.Session" | ||
2228 | 43 | 42 | ||
2229 | 44 | /** | 43 | /** |
2230 | 45 | *** | 44 | *** |
2231 | @@ -57,17 +56,19 @@ | |||
2232 | 57 | const gchar * user_object_path, | 56 | const gchar * user_object_path, |
2233 | 58 | UsersServiceDbus * service); | 57 | UsersServiceDbus * service); |
2234 | 59 | 58 | ||
2246 | 60 | static void on_session_added (ConsoleKitSeat * seat, | 59 | static void on_session_added (Login1Manager * proxy, |
2247 | 61 | const gchar * ssid, | 60 | const gchar * ssid, |
2248 | 62 | UsersServiceDbus * service); | 61 | const gchar * path, |
2249 | 63 | 62 | UsersServiceDbus * service); | |
2250 | 64 | static void on_session_removed (ConsoleKitSeat * seat, | 63 | |
2251 | 65 | const gchar * ssid, | 64 | static void on_session_removed (Login1Manager * proxy, |
2252 | 66 | UsersServiceDbus * service); | 65 | const gchar * ssid, |
2253 | 67 | 66 | const gchar * path, | |
2254 | 68 | static void on_session_list (ConsoleKitSeat * seat, | 67 | UsersServiceDbus * service); |
2255 | 69 | GAsyncResult * result, | 68 | |
2256 | 70 | UsersServiceDbus * service); | 69 | static void on_session_list (Login1Manager * proxy, |
2257 | 70 | GAsyncResult * result, | ||
2258 | 71 | UsersServiceDbus * service); | ||
2259 | 71 | 72 | ||
2260 | 72 | /*** | 73 | /*** |
2261 | 73 | **** Priv Struct | 74 | **** Priv Struct |
2262 | @@ -85,8 +86,7 @@ | |||
2263 | 85 | GHashTable * users; | 86 | GHashTable * users; |
2264 | 86 | 87 | ||
2265 | 87 | GCancellable * cancellable; | 88 | GCancellable * cancellable; |
2268 | 88 | ConsoleKitSeat * seat_proxy; | 89 | Login1Manager * manager_proxy; |
2267 | 89 | ConsoleKitManager * ck_manager_proxy; | ||
2269 | 90 | Accounts * accounts_proxy; | 90 | Accounts * accounts_proxy; |
2270 | 91 | }; | 91 | }; |
2271 | 92 | 92 | ||
2272 | @@ -112,8 +112,7 @@ | |||
2273 | 112 | UsersServiceDbusPrivate * priv = USERS_SERVICE_DBUS(object)->priv; | 112 | UsersServiceDbusPrivate * priv = USERS_SERVICE_DBUS(object)->priv; |
2274 | 113 | 113 | ||
2275 | 114 | g_clear_object (&priv->accounts_proxy); | 114 | g_clear_object (&priv->accounts_proxy); |
2278 | 115 | g_clear_object (&priv->seat_proxy); | 115 | g_clear_object (&priv->manager_proxy); |
2277 | 116 | g_clear_object (&priv->ck_manager_proxy); | ||
2279 | 117 | 116 | ||
2280 | 118 | if (priv->cancellable != NULL) | 117 | if (priv->cancellable != NULL) |
2281 | 119 | { | 118 | { |
2282 | @@ -211,14 +210,14 @@ | |||
2283 | 211 | g_object_unref); | 210 | g_object_unref); |
2284 | 212 | 211 | ||
2285 | 213 | /** | 212 | /** |
2287 | 214 | *** create the consolekit manager proxy... | 213 | *** create the logind manager proxy... |
2288 | 215 | **/ | 214 | **/ |
2289 | 216 | 215 | ||
2291 | 217 | p->ck_manager_proxy = console_kit_manager_proxy_new_for_bus_sync ( | 216 | p->manager_proxy = login1_manager_proxy_new_for_bus_sync ( |
2292 | 218 | G_BUS_TYPE_SYSTEM, | 217 | G_BUS_TYPE_SYSTEM, |
2293 | 219 | G_DBUS_PROXY_FLAGS_NONE, | 218 | G_DBUS_PROXY_FLAGS_NONE, |
2296 | 220 | "org.freedesktop.ConsoleKit", | 219 | "org.freedesktop.login1", |
2297 | 221 | "/org/freedesktop/ConsoleKit/Manager", | 220 | "/org/freedesktop/login1", |
2298 | 222 | NULL, | 221 | NULL, |
2299 | 223 | &error); | 222 | &error); |
2300 | 224 | if (error != NULL) | 223 | if (error != NULL) |
2301 | @@ -229,36 +228,13 @@ | |||
2302 | 229 | 228 | ||
2303 | 230 | p->seat = get_seat (self); | 229 | p->seat = get_seat (self); |
2304 | 231 | 230 | ||
2335 | 232 | /** | 231 | g_signal_connect (p->manager_proxy, "session-new", |
2336 | 233 | *** create the consolekit seat proxy... | 232 | G_CALLBACK (on_session_added), self); |
2337 | 234 | **/ | 233 | g_signal_connect (p->manager_proxy, "session-removed", |
2338 | 235 | 234 | G_CALLBACK (on_session_removed), self); | |
2339 | 236 | if (p->seat != NULL) | 235 | |
2340 | 237 | { | 236 | login1_manager_call_list_sessions (p->manager_proxy, p->cancellable, |
2341 | 238 | ConsoleKitSeat * proxy = console_kit_seat_proxy_new_for_bus_sync ( | 237 | (GAsyncReadyCallback) on_session_list, self); |
2312 | 239 | G_BUS_TYPE_SYSTEM, | ||
2313 | 240 | G_DBUS_PROXY_FLAGS_NONE, | ||
2314 | 241 | "org.freedesktop.ConsoleKit", | ||
2315 | 242 | p->seat, | ||
2316 | 243 | NULL, | ||
2317 | 244 | &error); | ||
2318 | 245 | |||
2319 | 246 | if (error != NULL) | ||
2320 | 247 | { | ||
2321 | 248 | g_warning ("Failed to connect to the ConsoleKit seat: %s", error->message); | ||
2322 | 249 | g_clear_error (&error); | ||
2323 | 250 | } | ||
2324 | 251 | else | ||
2325 | 252 | { | ||
2326 | 253 | g_signal_connect (proxy, "session-added", | ||
2327 | 254 | G_CALLBACK (on_session_added), self); | ||
2328 | 255 | g_signal_connect (proxy, "session-removed", | ||
2329 | 256 | G_CALLBACK (on_session_removed), self); | ||
2330 | 257 | console_kit_seat_call_get_sessions (proxy, p->cancellable, | ||
2331 | 258 | (GAsyncReadyCallback)on_session_list, self); | ||
2332 | 259 | p->seat_proxy = proxy; | ||
2333 | 260 | } | ||
2334 | 261 | } | ||
2342 | 262 | 238 | ||
2343 | 263 | /** | 239 | /** |
2344 | 264 | *** create the accounts manager proxy... | 240 | *** create the accounts manager proxy... |
2345 | @@ -311,75 +287,129 @@ | |||
2346 | 311 | **** | 287 | **** |
2347 | 312 | ***/ | 288 | ***/ |
2348 | 313 | 289 | ||
2369 | 314 | static ConsoleKitSession* | 290 | static Login1User* |
2370 | 315 | create_consolekit_session_proxy (const char * ssid) | 291 | create_login1_user_proxy (const char * path) |
2371 | 316 | { | 292 | { |
2372 | 317 | GError * error = NULL; | 293 | |
2373 | 318 | 294 | GError * error = NULL; | |
2374 | 319 | ConsoleKitSession * p = console_kit_session_proxy_new_for_bus_sync ( | 295 | |
2375 | 320 | G_BUS_TYPE_SYSTEM, | 296 | Login1User * p = login1_user_proxy_new_for_bus_sync ( |
2376 | 321 | G_DBUS_PROXY_FLAGS_NONE, | 297 | G_BUS_TYPE_SYSTEM, |
2377 | 322 | CK_ADDR, | 298 | G_DBUS_PROXY_FLAGS_NONE, |
2378 | 323 | ssid, | 299 | LOGIND_ADDR, |
2379 | 324 | NULL, | 300 | path, |
2380 | 325 | &error); | 301 | NULL, |
2381 | 326 | if (error != NULL) | 302 | &error); |
2382 | 327 | { | 303 | if (error != NULL) |
2383 | 328 | g_warning ("%s: %s", G_STRLOC, error->message); | 304 | { |
2384 | 329 | g_error_free (error); | 305 | g_warning ("%s: %s", G_STRLOC, error->message); |
2385 | 330 | } | 306 | g_error_free (error); |
2386 | 331 | 307 | } | |
2387 | 332 | return p; | 308 | |
2388 | 333 | } | 309 | return p; |
2389 | 310 | } | ||
2390 | 311 | |||
2391 | 312 | static Login1User * | ||
2392 | 313 | create_login1_user_proxy_from_uid (UsersServiceDbus * self, | ||
2393 | 314 | guint64 uid) | ||
2394 | 315 | { | ||
2395 | 316 | Login1Manager * manager = self->priv->manager_proxy; | ||
2396 | 317 | Login1User * user_proxy = NULL; | ||
2397 | 318 | gchar * user_object_path = NULL; | ||
2398 | 319 | GError * error = NULL; | ||
2399 | 320 | |||
2400 | 321 | login1_manager_call_get_user_sync (manager, uid, &user_object_path, NULL, | ||
2401 | 322 | &error); | ||
2402 | 323 | |||
2403 | 324 | if (error != NULL) | ||
2404 | 325 | { | ||
2405 | 326 | g_warning ("%s: %s", G_STRLOC, error->message); | ||
2406 | 327 | g_error_free (error); | ||
2407 | 328 | } | ||
2408 | 329 | |||
2409 | 330 | if (user_object_path != NULL) | ||
2410 | 331 | user_proxy = create_login1_user_proxy (user_object_path); | ||
2411 | 332 | |||
2412 | 333 | return user_proxy; | ||
2413 | 334 | |||
2414 | 335 | } | ||
2415 | 336 | |||
2416 | 337 | static Login1Session * | ||
2417 | 338 | create_login1_session_proxy (const char * path) | ||
2418 | 339 | { | ||
2419 | 340 | GError * error = NULL; | ||
2420 | 341 | |||
2421 | 342 | Login1Session * p = login1_session_proxy_new_for_bus_sync ( | ||
2422 | 343 | G_BUS_TYPE_SYSTEM, | ||
2423 | 344 | G_DBUS_PROXY_FLAGS_NONE, | ||
2424 | 345 | LOGIND_ADDR, | ||
2425 | 346 | path, | ||
2426 | 347 | NULL, | ||
2427 | 348 | &error); | ||
2428 | 349 | if (error != NULL) | ||
2429 | 350 | { | ||
2430 | 351 | g_warning ("%s: %s", G_STRLOC, error->message); | ||
2431 | 352 | g_error_free (error); | ||
2432 | 353 | } | ||
2433 | 354 | |||
2434 | 355 | return p; | ||
2435 | 356 | } | ||
2436 | 357 | |||
2437 | 334 | 358 | ||
2438 | 335 | static gchar * | 359 | static gchar * |
2440 | 336 | get_seat_from_session_proxy (ConsoleKitSession * session_proxy) | 360 | get_seat_from_session_proxy (Login1Session * session_proxy) |
2441 | 337 | { | 361 | { |
2443 | 338 | gchar * seat = NULL; | 362 | gchar * seat; |
2444 | 363 | GVariant * seatobj = login1_session_get_seat (session_proxy); | ||
2445 | 339 | 364 | ||
2456 | 340 | GError * error = NULL; | 365 | g_variant_get (seatobj, "(so)", &seat, NULL); |
2447 | 341 | console_kit_session_call_get_seat_id_sync (session_proxy, | ||
2448 | 342 | &seat, | ||
2449 | 343 | NULL, | ||
2450 | 344 | &error); | ||
2451 | 345 | if (error != NULL) | ||
2452 | 346 | { | ||
2453 | 347 | g_debug ("%s: %s", G_STRLOC, error->message); | ||
2454 | 348 | g_error_free (error); | ||
2455 | 349 | } | ||
2457 | 350 | 366 | ||
2458 | 351 | return seat; | 367 | return seat; |
2459 | 352 | } | 368 | } |
2460 | 353 | 369 | ||
2461 | 370 | static const gchar * | ||
2462 | 371 | get_display_from_session_proxy (Login1Session * session_proxy) | ||
2463 | 372 | { | ||
2464 | 373 | const gchar * display; | ||
2465 | 374 | display = login1_session_get_display (session_proxy); | ||
2466 | 375 | return display; | ||
2467 | 376 | } | ||
2468 | 377 | |||
2469 | 354 | static gchar * | 378 | static gchar * |
2470 | 355 | get_seat (UsersServiceDbus *service) | 379 | get_seat (UsersServiceDbus *service) |
2471 | 356 | { | 380 | { |
2472 | 357 | gchar * seat = NULL; | 381 | gchar * seat = NULL; |
2474 | 358 | gchar * ssid = NULL; | 382 | gchar * path = NULL; |
2475 | 359 | GError * error = NULL; | 383 | GError * error = NULL; |
2476 | 360 | UsersServiceDbusPrivate * priv = service->priv; | 384 | UsersServiceDbusPrivate * priv = service->priv; |
2482 | 361 | 385 | Login1Session * session_proxy = NULL; | |
2483 | 362 | console_kit_manager_call_get_current_session_sync (priv->ck_manager_proxy, | 386 | pid_t pid = getpid(); |
2484 | 363 | &ssid, | 387 | |
2485 | 364 | NULL, | 388 | login1_manager_call_get_session_by_pid_sync (priv->manager_proxy, |
2486 | 365 | &error); | 389 | pid, |
2487 | 390 | &path, | ||
2488 | 391 | NULL, | ||
2489 | 392 | &error); | ||
2490 | 393 | |||
2491 | 366 | 394 | ||
2492 | 367 | if (error != NULL) | 395 | if (error != NULL) |
2493 | 368 | { | 396 | { |
2494 | 369 | g_debug ("%s: %s", G_STRLOC, error->message); | 397 | g_debug ("%s: %s", G_STRLOC, error->message); |
2495 | 370 | g_error_free (error); | 398 | g_error_free (error); |
2496 | 399 | goto out; | ||
2497 | 371 | } | 400 | } |
2499 | 372 | else | 401 | |
2500 | 402 | session_proxy = create_login1_session_proxy (path); | ||
2501 | 403 | |||
2502 | 404 | if (!session_proxy) | ||
2503 | 373 | { | 405 | { |
2511 | 374 | ConsoleKitSession * session = create_consolekit_session_proxy (ssid); | 406 | g_debug ("%s: Could't get session proxy object", G_STRLOC); |
2505 | 375 | |||
2506 | 376 | if (session != NULL) | ||
2507 | 377 | { | ||
2508 | 378 | seat = get_seat_from_session_proxy (session); | ||
2509 | 379 | g_object_unref (session); | ||
2510 | 380 | } | ||
2512 | 381 | } | 407 | } |
2513 | 382 | 408 | ||
2514 | 409 | seat = get_seat_from_session_proxy (session_proxy); | ||
2515 | 410 | |||
2516 | 411 | out: | ||
2517 | 412 | g_object_unref (session_proxy); | ||
2518 | 383 | return seat; | 413 | return seat; |
2519 | 384 | } | 414 | } |
2520 | 385 | 415 | ||
2521 | @@ -434,9 +464,10 @@ | |||
2522 | 434 | static void | 464 | static void |
2523 | 435 | add_user_session (UsersServiceDbus * service, | 465 | add_user_session (UsersServiceDbus * service, |
2524 | 436 | AccountsUser * user, | 466 | AccountsUser * user, |
2526 | 437 | const gchar * ssid) | 467 | const gchar * ssid, |
2527 | 468 | const gchar * path) | ||
2528 | 438 | { | 469 | { |
2530 | 439 | ConsoleKitSession * session_proxy = create_consolekit_session_proxy (ssid); | 470 | Login1Session * session_proxy = create_login1_session_proxy (path); |
2531 | 440 | if (session_proxy != NULL) | 471 | if (session_proxy != NULL) |
2532 | 441 | { | 472 | { |
2533 | 442 | UsersServiceDbusPrivate * priv = service->priv; | 473 | UsersServiceDbusPrivate * priv = service->priv; |
2534 | @@ -446,12 +477,8 @@ | |||
2535 | 446 | if (seat && priv->seat && !g_strcmp0 (seat, priv->seat)) | 477 | if (seat && priv->seat && !g_strcmp0 (seat, priv->seat)) |
2536 | 447 | { | 478 | { |
2537 | 448 | /* does this session have a display? */ | 479 | /* does this session have a display? */ |
2544 | 449 | gchar * display = NULL; | 480 | const gchar * display = get_display_from_session_proxy (session_proxy); |
2545 | 450 | console_kit_session_call_get_x11_display_sync (session_proxy, | 481 | const gboolean has_display = g_strcmp0 ("", display) != 0; |
2540 | 451 | &display, | ||
2541 | 452 | NULL, NULL); | ||
2542 | 453 | const gboolean has_display = display && *display; | ||
2543 | 454 | g_free (display); | ||
2546 | 455 | 482 | ||
2547 | 456 | if (has_display) | 483 | if (has_display) |
2548 | 457 | { | 484 | { |
2549 | @@ -480,33 +507,30 @@ | |||
2550 | 480 | const char * username = accounts_user_get_user_name (user); | 507 | const char * username = accounts_user_get_user_name (user); |
2551 | 481 | g_debug ("%s adding %s (%i)", G_STRLOC, username, (int)uid); | 508 | g_debug ("%s adding %s (%i)", G_STRLOC, username, (int)uid); |
2552 | 482 | 509 | ||
2563 | 483 | GError * error = NULL; | 510 | GVariant * sessions = NULL; |
2564 | 484 | gchar ** sessions = NULL; | 511 | |
2565 | 485 | console_kit_manager_call_get_sessions_for_unix_user_sync ( | 512 | Login1User * user_proxy = create_login1_user_proxy_from_uid (self, uid); |
2566 | 486 | self->priv->ck_manager_proxy, | 513 | |
2567 | 487 | uid, | 514 | if (user_proxy != NULL) |
2558 | 488 | &sessions, | ||
2559 | 489 | NULL, | ||
2560 | 490 | &error); | ||
2561 | 491 | |||
2562 | 492 | if (error != NULL) | ||
2568 | 493 | { | 515 | { |
2571 | 494 | g_debug ("%s: %s", G_STRLOC, error->message); | 516 | sessions = login1_user_get_sessions (user_proxy); |
2570 | 495 | g_error_free (error); | ||
2572 | 496 | } | 517 | } |
2574 | 497 | else if (sessions != NULL) | 518 | |
2575 | 519 | if (sessions != NULL) | ||
2576 | 498 | { | 520 | { |
2578 | 499 | int i; | 521 | GVariantIter iter; |
2579 | 522 | g_variant_iter_init (&iter, sessions); | ||
2580 | 523 | gchar * id; | ||
2581 | 524 | gchar * object_path; | ||
2582 | 500 | 525 | ||
2584 | 501 | for (i=0; sessions[i]; i++) | 526 | while (g_variant_iter_loop (&iter, "(so)", &id, &object_path)) |
2585 | 502 | { | 527 | { |
2589 | 503 | const char * const ssid = sessions[i]; | 528 | g_debug ("%s adding %s's session %s", G_STRLOC, username, id); |
2590 | 504 | g_debug ("%s adding %s's session %s", G_STRLOC, username, ssid); | 529 | add_user_session (self, user, id, object_path); |
2588 | 505 | add_user_session (self, user, ssid); | ||
2591 | 506 | } | 530 | } |
2592 | 531 | } | ||
2593 | 507 | 532 | ||
2596 | 508 | g_strfreev (sessions); | 533 | g_object_unref (user_proxy); |
2595 | 509 | } | ||
2597 | 510 | } | 534 | } |
2598 | 511 | 535 | ||
2599 | 512 | /* returns true if this property is one we use */ | 536 | /* returns true if this property is one we use */ |
2600 | @@ -723,9 +747,10 @@ | |||
2601 | 723 | ***/ | 747 | ***/ |
2602 | 724 | 748 | ||
2603 | 725 | static void | 749 | static void |
2607 | 726 | on_session_removed (ConsoleKitSeat * seat_proxy, | 750 | on_session_removed (Login1Manager * proxy, |
2608 | 727 | const gchar * ssid, | 751 | const gchar * ssid, |
2609 | 728 | UsersServiceDbus * service) | 752 | const gchar * path, |
2610 | 753 | UsersServiceDbus * service) | ||
2611 | 729 | { | 754 | { |
2612 | 730 | g_return_if_fail (IS_USERS_SERVICE_DBUS (service)); | 755 | g_return_if_fail (IS_USERS_SERVICE_DBUS (service)); |
2613 | 731 | 756 | ||
2614 | @@ -757,42 +782,25 @@ | |||
2615 | 757 | } | 782 | } |
2616 | 758 | 783 | ||
2617 | 759 | static gchar* | 784 | static gchar* |
2620 | 760 | get_unix_username_from_ssid (UsersServiceDbus * self, | 785 | get_unix_username_from_path (UsersServiceDbus * self, |
2621 | 761 | const gchar * ssid) | 786 | const gchar * path) |
2622 | 762 | { | 787 | { |
2623 | 763 | gchar * username = NULL; | ||
2624 | 764 | 788 | ||
2626 | 765 | ConsoleKitSession * session_proxy = create_consolekit_session_proxy (ssid); | 789 | Login1Session * session_proxy = create_login1_session_proxy (path); |
2627 | 766 | if (session_proxy != NULL) | 790 | if (session_proxy != NULL) |
2628 | 767 | { | 791 | { |
2652 | 768 | guint uid = 0; | 792 | gchar * username = g_strdup (login1_session_get_name (session_proxy)); |
2653 | 769 | GError * error = NULL; | 793 | |
2654 | 770 | console_kit_session_call_get_unix_user_sync (session_proxy, | 794 | g_debug ("%s Getting username for %s: %s", G_STRLOC, path, username); |
2632 | 771 | &uid, | ||
2633 | 772 | NULL, &error); | ||
2634 | 773 | if (error != NULL) | ||
2635 | 774 | { | ||
2636 | 775 | g_warning ("%s: %s", G_STRLOC, error->message); | ||
2637 | 776 | g_clear_error (&error); | ||
2638 | 777 | } | ||
2639 | 778 | else | ||
2640 | 779 | { | ||
2641 | 780 | errno = 0; | ||
2642 | 781 | const struct passwd * pwent = getpwuid (uid); | ||
2643 | 782 | if (pwent == NULL) | ||
2644 | 783 | { | ||
2645 | 784 | g_warning ("Failed to lookup user id %d: %s", (int)uid, g_strerror(errno)); | ||
2646 | 785 | } | ||
2647 | 786 | else | ||
2648 | 787 | { | ||
2649 | 788 | username = g_strdup (pwent->pw_name); | ||
2650 | 789 | } | ||
2651 | 790 | } | ||
2655 | 791 | 795 | ||
2656 | 792 | g_object_unref (session_proxy); | 796 | g_object_unref (session_proxy); |
2657 | 797 | |||
2658 | 798 | return username; | ||
2659 | 799 | } | ||
2660 | 800 | else | ||
2661 | 801 | { | ||
2662 | 802 | return NULL; | ||
2663 | 793 | } | 803 | } |
2664 | 794 | |||
2665 | 795 | return username; | ||
2666 | 796 | } | 804 | } |
2667 | 797 | 805 | ||
2668 | 798 | static gboolean | 806 | static gboolean |
2669 | @@ -810,13 +818,14 @@ | |||
2670 | 810 | /* If the new session belongs to 'guest', update our guest_ssid. | 818 | /* If the new session belongs to 'guest', update our guest_ssid. |
2671 | 811 | Otherwise, call add_user_session() to update our session tables */ | 819 | Otherwise, call add_user_session() to update our session tables */ |
2672 | 812 | static void | 820 | static void |
2676 | 813 | on_session_added (ConsoleKitSeat * seat_proxy G_GNUC_UNUSED, | 821 | on_session_added (Login1Manager * proxy G_GNUC_UNUSED, |
2677 | 814 | const gchar * ssid, | 822 | const gchar * ssid, |
2678 | 815 | UsersServiceDbus * service) | 823 | const gchar * path, |
2679 | 824 | UsersServiceDbus * service) | ||
2680 | 816 | { | 825 | { |
2681 | 817 | g_return_if_fail (IS_USERS_SERVICE_DBUS(service)); | 826 | g_return_if_fail (IS_USERS_SERVICE_DBUS(service)); |
2682 | 818 | 827 | ||
2684 | 819 | gchar * username = get_unix_username_from_ssid (service, ssid); | 828 | gchar * username = get_unix_username_from_path (service, path); |
2685 | 820 | g_debug ("%s %s() username %s has new session %s", G_STRLOC, G_STRFUNC, username, ssid); | 829 | g_debug ("%s %s() username %s has new session %s", G_STRLOC, G_STRFUNC, username, ssid); |
2686 | 821 | 830 | ||
2687 | 822 | if (is_guest_username (username)) | 831 | if (is_guest_username (username)) |
2688 | @@ -834,45 +843,59 @@ | |||
2689 | 834 | 843 | ||
2690 | 835 | if (user != NULL) | 844 | if (user != NULL) |
2691 | 836 | { | 845 | { |
2693 | 837 | add_user_session (service, user, ssid); | 846 | add_user_session (service, user, ssid, path); |
2694 | 838 | emit_user_login_changed (service, user); | 847 | emit_user_login_changed (service, user); |
2695 | 839 | } | 848 | } |
2696 | 840 | } | 849 | } |
2697 | 841 | 850 | ||
2698 | 842 | g_free (username); | ||
2699 | 843 | } | 851 | } |
2700 | 844 | 852 | ||
2701 | 845 | /* Receives a list of sessions and calls on_session_added() for each of them */ | 853 | /* Receives a list of sessions and calls on_session_added() for each of them */ |
2702 | 846 | static void | 854 | static void |
2704 | 847 | on_session_list (ConsoleKitSeat * seat_proxy, | 855 | on_session_list (Login1Manager * proxy, |
2705 | 848 | GAsyncResult * result, | 856 | GAsyncResult * result, |
2706 | 849 | UsersServiceDbus * self) | 857 | UsersServiceDbus * self) |
2707 | 850 | { | 858 | { |
2708 | 851 | GError * error = NULL; | 859 | GError * error = NULL; |
2710 | 852 | gchar ** sessions = NULL; | 860 | GVariant * sessions; |
2711 | 853 | g_debug ("%s bootstrapping the session list", G_STRLOC); | 861 | g_debug ("%s bootstrapping the session list", G_STRLOC); |
2712 | 854 | 862 | ||
2717 | 855 | console_kit_seat_call_get_sessions_finish (seat_proxy, | 863 | login1_manager_call_list_sessions_finish (proxy, |
2718 | 856 | &sessions, | 864 | &sessions, |
2719 | 857 | result, | 865 | result, |
2720 | 858 | &error); | 866 | &error); |
2721 | 859 | 867 | ||
2722 | 860 | if (error != NULL) | 868 | if (error != NULL) |
2723 | 861 | { | 869 | { |
2724 | 862 | g_debug ("%s: %s", G_STRLOC, error->message); | 870 | g_debug ("%s: %s", G_STRLOC, error->message); |
2725 | 863 | g_error_free (error); | 871 | g_error_free (error); |
2726 | 864 | } | 872 | } |
2728 | 865 | else if (sessions != NULL) | 873 | else |
2729 | 866 | { | 874 | { |
2733 | 867 | int i; | 875 | GVariantIter * iter; |
2734 | 868 | 876 | gchar * seat; | |
2735 | 869 | for (i=0; sessions[i]; i++) | 877 | gchar * path; |
2736 | 878 | |||
2737 | 879 | g_variant_get (sessions, "a(susso)", &iter); | ||
2738 | 880 | |||
2739 | 881 | while (g_variant_iter_loop (iter, | ||
2740 | 882 | "(susso)", | ||
2741 | 883 | NULL, | ||
2742 | 884 | NULL, | ||
2743 | 885 | NULL, | ||
2744 | 886 | &seat, | ||
2745 | 887 | &path)) | ||
2746 | 870 | { | 888 | { |
2749 | 871 | g_debug ("%s adding initial session '%s'", G_STRLOC, sessions[i]); | 889 | if (g_strcmp0 (seat, self->priv->seat) == 0) |
2750 | 872 | on_session_added (seat_proxy, sessions[i], self); | 890 | { |
2751 | 891 | g_debug ("%s adding initial session '%s'", G_STRLOC, path); | ||
2752 | 892 | on_session_added (proxy, seat, path, self); | ||
2753 | 893 | } | ||
2754 | 873 | } | 894 | } |
2755 | 874 | 895 | ||
2757 | 875 | g_strfreev (sessions); | 896 | g_variant_iter_free (iter); |
2758 | 897 | g_variant_unref (sessions); | ||
2759 | 898 | |||
2760 | 876 | } | 899 | } |
2761 | 877 | 900 | ||
2762 | 878 | g_debug ("%s done bootstrapping the session list", G_STRLOC); | 901 | g_debug ("%s done bootstrapping the session list", G_STRLOC); |
2763 | @@ -1005,27 +1028,6 @@ | |||
2764 | 1005 | } | 1028 | } |
2765 | 1006 | 1029 | ||
2766 | 1007 | gboolean | 1030 | gboolean |
2767 | 1008 | users_service_dbus_can_activate_session (UsersServiceDbus * self) | ||
2768 | 1009 | { | ||
2769 | 1010 | gboolean can_activate = FALSE; | ||
2770 | 1011 | |||
2771 | 1012 | g_return_val_if_fail (IS_USERS_SERVICE_DBUS(self), can_activate); | ||
2772 | 1013 | |||
2773 | 1014 | GError * error = NULL; | ||
2774 | 1015 | console_kit_seat_call_can_activate_sessions_sync (self->priv->seat_proxy, | ||
2775 | 1016 | &can_activate, | ||
2776 | 1017 | NULL, | ||
2777 | 1018 | &error); | ||
2778 | 1019 | if (error != NULL) | ||
2779 | 1020 | { | ||
2780 | 1021 | g_warning ("%s: %s", G_STRLOC, error->message); | ||
2781 | 1022 | g_error_free (error); | ||
2782 | 1023 | } | ||
2783 | 1024 | |||
2784 | 1025 | return can_activate; | ||
2785 | 1026 | } | ||
2786 | 1027 | |||
2787 | 1028 | gboolean | ||
2788 | 1029 | users_service_dbus_is_guest_logged_in (UsersServiceDbus * self) | 1031 | users_service_dbus_is_guest_logged_in (UsersServiceDbus * self) |
2789 | 1030 | { | 1032 | { |
2790 | 1031 | g_return_val_if_fail (IS_USERS_SERVICE_DBUS(self), FALSE); | 1033 | g_return_val_if_fail (IS_USERS_SERVICE_DBUS(self), FALSE); |
2791 | 1032 | 1034 | ||
2792 | === modified file 'src/users-service-dbus.h' | |||
2793 | --- src/users-service-dbus.h 2012-06-13 19:41:31 +0000 | |||
2794 | +++ src/users-service-dbus.h 2013-04-22 12:49:38 +0000 | |||
2795 | @@ -52,8 +52,8 @@ | |||
2796 | 52 | * 2. Track which users currently have X sessions. | 52 | * 2. Track which users currently have X sessions. |
2797 | 53 | * This is used for the menuitems' USER_ITEM_PROP_LOGGED_IN property. | 53 | * This is used for the menuitems' USER_ITEM_PROP_LOGGED_IN property. |
2798 | 54 | * | 54 | * |
2801 | 55 | * We initially build this list by calling org.freedesktop.ConsoleKit.Seat's | 55 | * We initially build this list by calling org.freedesktop.login1's |
2802 | 56 | * GetDevices method. We also monitor the seat for SessionAdded and | 56 | * ListSessions method. We also monitor the seat for SessionNew and |
2803 | 57 | * SessionRemoved and update the list accordingly. | 57 | * SessionRemoved and update the list accordingly. |
2804 | 58 | * | 58 | * |
2805 | 59 | * 3. Provide an API for user switching and guest sessions. | 59 | * 3. Provide an API for user switching and guest sessions. |
2806 | @@ -87,7 +87,6 @@ | |||
2807 | 87 | 87 | ||
2808 | 88 | void users_service_dbus_show_greeter (UsersServiceDbus * self); | 88 | void users_service_dbus_show_greeter (UsersServiceDbus * self); |
2809 | 89 | gboolean users_service_dbus_guest_session_enabled (UsersServiceDbus * self); | 89 | gboolean users_service_dbus_guest_session_enabled (UsersServiceDbus * self); |
2810 | 90 | gboolean users_service_dbus_can_activate_session (UsersServiceDbus * self); | ||
2811 | 91 | void users_service_dbus_activate_guest_session (UsersServiceDbus * self); | 90 | void users_service_dbus_activate_guest_session (UsersServiceDbus * self); |
2812 | 92 | void users_service_dbus_activate_user_session (UsersServiceDbus * self, | 91 | void users_service_dbus_activate_user_session (UsersServiceDbus * self, |
2813 | 93 | AccountsUser * user); | 92 | AccountsUser * user); |
PASSED: Continuous integration, rev:393 jenkins. qa.ubuntu. com/job/ indicator- session- ci/57/ jenkins. qa.ubuntu. com/job/ indicator- session- raring- amd64-ci/ 3
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ indicator- session- ci/57/rebuild
http://