aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-07-01 12:46:00 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-07-01 12:46:00 -0500
commit0b5f283691222c23599ab460bb5dad7a78378aa8 (patch)
treecfea46bc352b4ba9765a9a7f5bfd960a0bcdfd7b
parent90c7f19eeaf0c89e40ddd59f00edbb0d7b1c0789 (diff)
downloadayatana-indicator-session-0b5f283691222c23599ab460bb5dad7a78378aa8.tar.gz
ayatana-indicator-session-0b5f283691222c23599ab460bb5dad7a78378aa8.tar.bz2
ayatana-indicator-session-0b5f283691222c23599ab460bb5dad7a78378aa8.zip
in backend-dbus/actions.c, create a separate cancellable for dm_seat s.t. new calls to set_dm_seat() will cancel any previous async calls pending on the old DisplayManager seat object.
-rw-r--r--src/backend-dbus/actions.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c
index c40d0c6..c095896 100644
--- a/src/backend-dbus/actions.c
+++ b/src/backend-dbus/actions.c
@@ -37,14 +37,15 @@ enum
struct _IndicatorSessionActionsDbusPriv
{
GCancellable * cancellable;
- GCancellable * login1_manager_cancellable;
GSettings * lockdown_settings;
GnomeScreenSaver * screen_saver;
GnomeSessionManager * session_manager;
Login1Manager * login1_manager;
+ GCancellable * login1_manager_cancellable;
Login1Seat * login1_seat;
DisplayManagerSeat * dm_seat;
+ GCancellable * dm_seat_cancellable;
Webcredentials * webcredentials;
EndSessionDialog * end_session_dialog;
@@ -124,10 +125,18 @@ set_dm_seat (IndicatorSessionActionsDbus * self, DisplayManagerSeat * seat)
{
priv_t * p = self->priv;
- g_clear_object (&p->dm_seat);
+ if (p->dm_seat != NULL)
+ {
+ g_cancellable_cancel (p->dm_seat_cancellable);
+ g_clear_object (&p->dm_seat);
+ g_clear_object (&p->dm_seat);
+ }
if (seat != NULL)
- p->dm_seat = g_object_ref (seat);
+ {
+ p->dm_seat = g_object_ref (seat);
+ p->dm_seat_cancellable = g_cancellable_new ();
+ }
}
static void
@@ -570,7 +579,8 @@ my_switch_to_greeter (IndicatorSessionActions * self)
g_return_if_fail (p->dm_seat != NULL);
- display_manager_seat_call_switch_to_greeter (p->dm_seat, p->cancellable,
+ display_manager_seat_call_switch_to_greeter (p->dm_seat,
+ p->dm_seat_cancellable,
NULL, NULL);
}
@@ -582,7 +592,7 @@ my_switch_to_guest (IndicatorSessionActions * self)
g_return_if_fail (p->dm_seat != NULL);
display_manager_seat_call_switch_to_guest (p->dm_seat, "",
- p->cancellable,
+ p->dm_seat_cancellable,
NULL, NULL);
}
@@ -594,7 +604,7 @@ my_switch_to_username (IndicatorSessionActions * self, const char * username)
g_return_if_fail (p->dm_seat != NULL);
display_manager_seat_call_switch_to_user (p->dm_seat, username, "",
- p->cancellable,
+ p->dm_seat_cancellable,
NULL, NULL);
}