Commit e5cd0f60 authored by Guido Gunther's avatar Guido Gunther
Browse files

screen-saver-manager: Properly signal screen blank not lock


Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent 484c0b42
Pipeline #66072 passed with stages
in 39 minutes and 56 seconds
...@@ -257,27 +257,21 @@ phosh_screen_saver_manager_screen_saver_iface_init (PhoshScreenSaverDBusScreenSa ...@@ -257,27 +257,21 @@ phosh_screen_saver_manager_screen_saver_iface_init (PhoshScreenSaverDBusScreenSa
} }
static void static void
on_lockscreen_manager_notify_locked (PhoshScreenSaverManager *self, notify_active_changed (PhoshScreenSaverManager *self)
GParamSpec *pspec,
PhoshLockscreenManager *lockscreen_manager)
{ {
gboolean locked;
GDBusInterfaceSkeleton *skeleton; GDBusInterfaceSkeleton *skeleton;
g_return_if_fail (PHOSH_IS_SCREEN_SAVER_MANAGER (self)); g_return_if_fail (PHOSH_IS_SCREEN_SAVER_MANAGER (self));
g_return_if_fail (PHOSH_IS_LOCKSCREEN_MANAGER (lockscreen_manager));
skeleton = G_DBUS_INTERFACE_SKELETON (self); skeleton = G_DBUS_INTERFACE_SKELETON (self);
locked = phosh_lockscreen_manager_get_locked(self->lockscreen_manager);
/* TODO: should we also signal on active changed ? */ g_debug ("Signaling ActiveChanged: %d", self->active);
g_debug ("Signaling ActiveChanged: %d", locked);
g_dbus_connection_emit_signal (g_dbus_interface_skeleton_get_connection (skeleton), g_dbus_connection_emit_signal (g_dbus_interface_skeleton_get_connection (skeleton),
NULL, NULL,
g_dbus_interface_skeleton_get_object_path (skeleton), g_dbus_interface_skeleton_get_object_path (skeleton),
SCREEN_SAVER_DBUS_NAME, SCREEN_SAVER_DBUS_NAME,
"ActiveChanged", "ActiveChanged",
g_variant_new ("(b)", locked), g_variant_new ("(b)", self->active),
NULL); NULL);
} }
...@@ -347,11 +341,8 @@ on_name_acquired (GDBusConnection *connection, ...@@ -347,11 +341,8 @@ on_name_acquired (GDBusConnection *connection,
end up sending out signals early */ end up sending out signals early */
g_object_connect ( g_object_connect (
self->lockscreen_manager, self->lockscreen_manager,
"swapped-object-signal::notify::locked", G_CALLBACK (on_lockscreen_manager_notify_locked), self,
"swapped-object-signal::wakeup-outputs", G_CALLBACK (on_lockscreen_manager_wakeup_outputs), self, "swapped-object-signal::wakeup-outputs", G_CALLBACK (on_lockscreen_manager_wakeup_outputs), self,
NULL); NULL);
on_lockscreen_manager_notify_locked (self, NULL, self->lockscreen_manager);
} }
...@@ -501,6 +492,7 @@ on_primary_monitor_power_mode_changed (PhoshScreenSaverManager *self, ...@@ -501,6 +492,7 @@ on_primary_monitor_power_mode_changed (PhoshScreenSaverManager *self,
if (active != self->active) { if (active != self->active) {
self->active = active; self->active = active;
g_object_notify_by_pspec(G_OBJECT (self), props[PROP_ACTIVE]); g_object_notify_by_pspec(G_OBJECT (self), props[PROP_ACTIVE]);
notify_active_changed (self);
} }
} }
......
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