Commit ff5eac6d authored by Matthias Clasen's avatar Matthias Clasen

Merge branch 'wip/rah/screensaver-active-fix' into 'master'

gtkapplication-dbus: Initialise screensaver-active property

See merge request !1091
parents 4987cb04 6bfe1710
Pipeline #115344 passed with stages
in 18 minutes and 16 seconds
......@@ -358,8 +358,31 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
if (dbus->ss_proxy)
{
GVariant *active_var;
gboolean active;
g_signal_connect (dbus->ss_proxy, "g-signal",
G_CALLBACK (screensaver_signal_session), impl->application);
active_var = g_dbus_proxy_call_sync (dbus->ss_proxy,
"GetActive",
NULL,
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,
NULL,
&error);
if (!active_var)
{
g_debug ("Error calling GetActive on GNOME screensaver: %s",
error->message);
g_clear_error (&error);
}
else
{
g_variant_get (active_var, "(b)", &active);
g_variant_unref (active_var);
gtk_application_set_screensaver_active (dbus->impl.application, active);
}
}
g_debug ("Registering client '%s' '%s'", dbus->application_id, client_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment