MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / suspend_logind

Function suspend_logind

gtk/src/callbacks.c:153–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static void
154suspend_logind (void)
155{
156#if !defined(_WIN32)
157 GDBusProxy *proxy;
158 GError *error = NULL;
159 GVariant *res;
160
161 ghb_log_func();
162 proxy = ghb_get_dbus_proxy(G_BUS_TYPE_SYSTEM, DBUS_LOGIND_SERVICE,
163 DBUS_LOGIND_PATH, DBUS_LOGIND_INTERFACE);
164 if (proxy == NULL)
165 return;
166
167 res = g_dbus_proxy_call_sync(proxy, "Suspend", g_variant_new("(b)", FALSE),
168 G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
169 if (!res)
170 {
171 if (error != NULL)
172 {
173 g_warning("Suspend failed: %s", error->message);
174 g_error_free(error);
175 }
176 else
177 g_warning("Suspend failed");
178 }
179 else
180 {
181 g_variant_unref(res);
182 }
183 g_object_unref(G_OBJECT(proxy));
184#endif
185}
186
187static gboolean
188can_shutdown_logind (void)

Callers 1

suspend_cbFunction · 0.85

Calls 1

ghb_get_dbus_proxyFunction · 0.85

Tested by

no test coverage detected