aboutsummaryrefslogtreecommitdiff
path: root/src/backend-dbus/guest.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-25 12:32:16 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-25 12:32:16 -0500
commit9ed837fbafae3021d597508ba9272a54d3623534 (patch)
tree556bbe93e2b961a564ae31c48592e9444258599e /src/backend-dbus/guest.c
parent7a995d0b4466b12be7b7f297d1f964aae37eae63 (diff)
downloadayatana-indicator-session-9ed837fbafae3021d597508ba9272a54d3623534.tar.gz
ayatana-indicator-session-9ed837fbafae3021d597508ba9272a54d3623534.tar.bz2
ayatana-indicator-session-9ed837fbafae3021d597508ba9272a54d3623534.zip
test-guest's HelloWorld and Allowed tests now pass
Diffstat (limited to 'src/backend-dbus/guest.c')
-rw-r--r--src/backend-dbus/guest.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/backend-dbus/guest.c b/src/backend-dbus/guest.c
index fcb3604..08ac648 100644
--- a/src/backend-dbus/guest.c
+++ b/src/backend-dbus/guest.c
@@ -193,17 +193,6 @@ set_login1_manager (IndicatorSessionGuestDbus * self,
}
static void
-update_guest_allowed (IndicatorSessionGuestDbus * self)
-{
- priv_t * p = self->priv;
-
- gboolean allowed = p->login1_seat
- && login1_seat_get_can_multi_session (p->login1_seat);
-
- set_guest_is_allowed_flag (self, allowed);
-}
-
-static void
set_login1_seat (IndicatorSessionGuestDbus * self,
Login1Seat * login1_seat)
{
@@ -222,10 +211,6 @@ set_login1_seat (IndicatorSessionGuestDbus * self,
g_signal_connect_swapped (login1_seat, "notify::active-session",
G_CALLBACK(update_session_list), self);
update_session_list (self);
-
- g_signal_connect_swapped (login1_seat, "notify::can-multi-session",
- G_CALLBACK(update_guest_allowed), self);
- update_guest_allowed (self);
}
}
@@ -269,13 +254,36 @@ my_switch_to_guest (IndicatorSessionGuest * guest)
}
static void
+on_notify_has_guest_account (DisplayManagerSeat * dm_seat,
+ GParamSpec * pspec G_GNUC_UNUSED,
+ IndicatorSessionGuestDbus * self)
+{
+ gboolean guest_exists = display_manager_seat_get_has_guest_account (dm_seat);
+ set_guest_is_allowed_flag (self, guest_exists);
+}
+
+static void
set_display_manager_seat (IndicatorSessionGuestDbus * self,
DisplayManagerSeat * dm_seat)
{
- g_clear_object (&self->priv->dm_seat);
+ priv_t * p = self->priv;
+
+ if (p->dm_seat != NULL)
+ {
+ g_signal_handlers_disconnect_by_data (p->dm_seat, self);
+
+ g_clear_object (&p->dm_seat);
+ }
if (dm_seat != NULL)
- self->priv->dm_seat = g_object_ref (dm_seat);
+ {
+ p->dm_seat = g_object_ref (dm_seat);
+
+ g_signal_connect (dm_seat, "notify::has-guest-account",
+ G_CALLBACK(on_notify_has_guest_account), self);
+ on_notify_has_guest_account (dm_seat, NULL, self);
+ }
+
}
/***