aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac15
-rw-r--r--src/session-menu-mgr.c10
-rw-r--r--src/users-service-dbus.c52
3 files changed, 51 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac
index bb46782..aadb24e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,7 @@
-
-AC_INIT(src/indicator-session.c)
-
-AC_PREREQ(2.53)
-
-AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(indicator-session, 12.10.4)
+AC_INIT([indicator-session],[12.10.4])
+AC_CONFIG_SRCDIR([src/session-menu-mgr.c])
+AM_INIT_AUTOMAKE([check-news])
+AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
@@ -16,8 +13,8 @@ AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
-AC_STDC_HEADERS
-AC_PROG_LIBTOOL
+AC_HEADER_STDC
+LT_INIT
AC_SUBST(VERSION)
AC_CONFIG_MACRO_DIR([m4])
diff --git a/src/session-menu-mgr.c b/src/session-menu-mgr.c
index 697218f..427f274 100644
--- a/src/session-menu-mgr.c
+++ b/src/session-menu-mgr.c
@@ -775,6 +775,7 @@ user_menuitem_new (AccountsUser * user, SessionMenuMgr * mgr)
/* set the is-current-user property */
const gboolean is_current_user =
!g_strcmp0 (g_get_user_name(), accounts_user_get_user_name(user));
+
dbusmenu_menuitem_property_set_bool (mi,
USER_ITEM_PROP_IS_CURRENT_USER,
is_current_user);
@@ -1077,9 +1078,14 @@ static void
action_func_switch_to_user (AccountsUser * user)
{
SessionMenuMgr * mgr = user_get_mgr (user);
+
g_return_if_fail (mgr != NULL);
- action_func_lock (mgr);
- users_service_dbus_activate_user_session (mgr->users_dbus_facade, user);
+
+ if (g_strcmp0 (g_get_user_name(), accounts_user_get_user_name(user)) != 0)
+ {
+ action_func_lock (mgr);
+ users_service_dbus_activate_user_session (mgr->users_dbus_facade, user);
+ }
}
static void
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index fec17dc..f12f47c 100644
--- a/src/users-service-dbus.c
+++ b/src/users-service-dbus.c
@@ -927,11 +927,16 @@ users_service_dbus_get_user_list (UsersServiceDbus * self)
void
users_service_dbus_show_greeter (UsersServiceDbus * self)
{
+ DisplayManagerSeat * dp;
+
g_return_if_fail (IS_USERS_SERVICE_DBUS(self));
- DisplayManagerSeat * dp = create_display_proxy (self);
- display_manager_seat_call_switch_to_greeter_sync (dp, NULL, NULL);
- g_clear_object (&dp);
+ dp = create_display_proxy (self);
+ if (dp != NULL)
+ {
+ display_manager_seat_call_switch_to_greeter_sync (dp, NULL, NULL);
+ g_clear_object (&dp);
+ }
}
/**
@@ -942,11 +947,16 @@ users_service_dbus_show_greeter (UsersServiceDbus * self)
void
users_service_dbus_activate_guest_session (UsersServiceDbus * self)
{
- g_return_if_fail(IS_USERS_SERVICE_DBUS(self));
+ DisplayManagerSeat * dp;
- DisplayManagerSeat * dp = create_display_proxy (self);
- display_manager_seat_call_switch_to_guest_sync (dp, "", NULL, NULL);
- g_clear_object (&dp);
+ g_return_if_fail (IS_USERS_SERVICE_DBUS(self));
+
+ dp = create_display_proxy (self);
+ if (dp != NULL)
+ {
+ display_manager_seat_call_switch_to_guest_sync (dp, "", NULL, NULL);
+ g_clear_object (&dp);
+ }
}
/**
@@ -958,12 +968,17 @@ void
users_service_dbus_activate_user_session (UsersServiceDbus * self,
AccountsUser * user)
{
+ DisplayManagerSeat * dp;
+
g_return_if_fail (IS_USERS_SERVICE_DBUS(self));
- const char * const username = accounts_user_get_user_name (user);
- DisplayManagerSeat * dp = create_display_proxy (self);
- display_manager_seat_call_switch_to_user_sync (dp, username, "", NULL, NULL);
- g_clear_object (&dp);
+ dp = create_display_proxy (self);
+ if (dp != NULL)
+ {
+ const char * const username = accounts_user_get_user_name (user);
+ display_manager_seat_call_switch_to_user_sync (dp, username, "", NULL, NULL);
+ g_clear_object (&dp);
+ }
}
/**
@@ -974,11 +989,18 @@ users_service_dbus_activate_user_session (UsersServiceDbus * self,
gboolean
users_service_dbus_guest_session_enabled (UsersServiceDbus * self)
{
- g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
+ DisplayManagerSeat * dp;
+ gboolean enabled = FALSE;
+
+ g_return_val_if_fail (IS_USERS_SERVICE_DBUS(self), enabled);
+
+ dp = create_display_proxy (self);
+ if (dp != NULL)
+ {
+ enabled = display_manager_seat_get_has_guest_account (dp);
+ g_clear_object (&dp);
+ }
- DisplayManagerSeat * dp = create_display_proxy (self);
- const gboolean enabled = display_manager_seat_get_has_guest_account (dp);
- g_clear_object (&dp);
return enabled;
}