diff -Nru indicator-session-0.2.1/aclocal.m4 indicator-session-0.2.2/aclocal.m4 --- indicator-session-0.2.1/aclocal.m4 2010-02-05 01:14:57.000000000 +0000 +++ indicator-session-0.2.2/aclocal.m4 2010-02-11 16:43:57.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -8862,7 +8862,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11], [], +m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -8878,7 +8878,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11])dnl +[AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff -Nru indicator-session-0.2.1/configure indicator-session-0.2.2/configure --- indicator-session-0.2.1/configure 2010-02-05 01:14:59.000000000 +0000 +++ indicator-session-0.2.2/configure 2010-02-11 16:44:00.000000000 +0000 @@ -2866,7 +2866,7 @@ # Define the identity of the package. PACKAGE=indicator-session - VERSION=0.2.1 + VERSION=0.2.2 cat >>confdefs.h <<_ACEOF diff -Nru indicator-session-0.2.1/configure.ac indicator-session-0.2.2/configure.ac --- indicator-session-0.2.1/configure.ac 2010-02-05 01:08:30.000000000 +0000 +++ indicator-session-0.2.2/configure.ac 2010-02-11 16:43:48.000000000 +0000 @@ -4,7 +4,7 @@ AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.2.1) +AM_INIT_AUTOMAKE(indicator-session, 0.2.2) AM_MAINTAINER_MODE diff -Nru indicator-session-0.2.1/data/icons/16x16/actions/Makefile.in indicator-session-0.2.2/data/icons/16x16/actions/Makefile.in --- indicator-session-0.2.1/data/icons/16x16/actions/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/16x16/actions/Makefile.in 2010-02-11 16:43:58.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru indicator-session-0.2.1/data/icons/16x16/Makefile.in indicator-session-0.2.2/data/icons/16x16/Makefile.in --- indicator-session-0.2.1/data/icons/16x16/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/16x16/Makefile.in 2010-02-11 16:43:58.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -294,7 +294,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -319,7 +319,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/data/icons/22x22/actions/Makefile.in indicator-session-0.2.2/data/icons/22x22/actions/Makefile.in --- indicator-session-0.2.1/data/icons/22x22/actions/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/22x22/actions/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru indicator-session-0.2.1/data/icons/22x22/Makefile.in indicator-session-0.2.2/data/icons/22x22/Makefile.in --- indicator-session-0.2.1/data/icons/22x22/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/22x22/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -294,7 +294,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -319,7 +319,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/data/icons/24x24/actions/Makefile.in indicator-session-0.2.2/data/icons/24x24/actions/Makefile.in --- indicator-session-0.2.1/data/icons/24x24/actions/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/24x24/actions/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru indicator-session-0.2.1/data/icons/24x24/Makefile.in indicator-session-0.2.2/data/icons/24x24/Makefile.in --- indicator-session-0.2.1/data/icons/24x24/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/24x24/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -294,7 +294,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -319,7 +319,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/data/icons/32x32/actions/Makefile.in indicator-session-0.2.2/data/icons/32x32/actions/Makefile.in --- indicator-session-0.2.1/data/icons/32x32/actions/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/32x32/actions/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru indicator-session-0.2.1/data/icons/32x32/Makefile.in indicator-session-0.2.2/data/icons/32x32/Makefile.in --- indicator-session-0.2.1/data/icons/32x32/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/32x32/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -294,7 +294,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -319,7 +319,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/data/icons/Makefile.in indicator-session-0.2.2/data/icons/Makefile.in --- indicator-session-0.2.1/data/icons/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -295,7 +295,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -320,7 +320,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/data/icons/scalable/actions/Makefile.in indicator-session-0.2.2/data/icons/scalable/actions/Makefile.in --- indicator-session-0.2.1/data/icons/scalable/actions/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/scalable/actions/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru indicator-session-0.2.1/data/icons/scalable/Makefile.in indicator-session-0.2.2/data/icons/scalable/Makefile.in --- indicator-session-0.2.1/data/icons/scalable/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/icons/scalable/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -294,7 +294,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -319,7 +319,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/data/Makefile.in indicator-session-0.2.2/data/Makefile.in --- indicator-session-0.2.1/data/Makefile.in 2010-02-05 01:14:58.000000000 +0000 +++ indicator-session-0.2.2/data/Makefile.in 2010-02-11 16:43:58.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -388,7 +388,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -413,7 +413,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/debian/changelog indicator-session-0.2.2/debian/changelog --- indicator-session-0.2.1/debian/changelog 2010-02-11 20:36:12.000000000 +0000 +++ indicator-session-0.2.2/debian/changelog 2010-02-11 20:36:13.000000000 +0000 @@ -1,3 +1,19 @@ +indicator-session (0.2.2-0ubuntu1~karmic1) karmic; urgency=low + + * merged for karmic + + -- Ken VanDine Thu, 11 Feb 2010 15:25:50 -0500 + +indicator-session (0.2.2-0ubuntu1) lucid; urgency=low + + * Upstream release 0.2.2 + * Check the user_switching lockdown key to disable user_switching + * Only create the screensaver proxy when needed. + * Removing unneeded GPM proxy + * Fixing and reenabling user switching + + -- Ted Gould Thu, 11 Feb 2010 10:53:06 -0600 + indicator-session (0.2.1-0ubuntu1~karmic1) karmic; urgency=low * merged for karmic diff -Nru indicator-session-0.2.1/Makefile.in indicator-session-0.2.2/Makefile.in --- indicator-session-0.2.1/Makefile.in 2010-02-05 01:14:59.000000000 +0000 +++ indicator-session-0.2.2/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -341,7 +341,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -366,7 +366,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -530,7 +530,8 @@ fi; \ done -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ @@ -574,17 +575,17 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac diff -Nru indicator-session-0.2.1/src/gtk-dialog/Makefile.in indicator-session-0.2.2/src/gtk-dialog/Makefile.in --- indicator-session-0.2.1/src/gtk-dialog/Makefile.in 2010-02-05 01:14:59.000000000 +0000 +++ indicator-session-0.2.2/src/gtk-dialog/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru indicator-session-0.2.1/src/lock-helper.c indicator-session-0.2.2/src/lock-helper.c --- indicator-session-0.2.1/src/lock-helper.c 2010-02-11 20:36:12.000000000 +0000 +++ indicator-session-0.2.2/src/lock-helper.c 2010-02-08 22:46:18.000000000 +0000 @@ -27,13 +27,9 @@ static guint cookie = 0; static DBusGProxyCall * cookie_call = NULL; -static DBusGProxy * gdm_settings_proxy = NULL; -static gboolean gdm_auto_login = FALSE; -static const gchar * gdm_auto_login_string = "daemon/AutomaticLoginEnable"; - static gboolean is_guest = FALSE; -static gdm_autologin_cb_t gdm_autologin_cb = NULL; +void build_gss_proxy (void); /* Checks to see if there is an error and reports it. Not much else we can do. */ @@ -56,6 +52,9 @@ { g_return_if_fail(cookie != 0); + build_gss_proxy(); + g_return_if_fail(gss_proxy != NULL); + dbus_g_proxy_begin_call(gss_proxy, "UnThrottle", unthrottle_return, NULL, NULL, @@ -103,6 +102,9 @@ screensaver_unthrottle(); } + build_gss_proxy(); + g_return_if_fail(gss_proxy != NULL); + cookie_call = dbus_g_proxy_begin_call(gss_proxy, "Throttle", throttle_return, NULL, NULL, @@ -113,28 +115,11 @@ return; } -/* Setting up a call back */ -void -lock_screen_gdm_cb_set (gdm_autologin_cb_t cb) -{ - if (gdm_autologin_cb) { - g_warning("Already had a callback, setting up a new one..."); - } - - gdm_autologin_cb = cb; - return; -} - /* This is our logic on whether the screen should be locked or not. It effects everything else. */ gboolean will_lock_screen (void) { -/* - if (gdm_auto_login) { - return FALSE; - } -*/ if (is_guest) { return FALSE; } @@ -142,95 +127,6 @@ return TRUE; } -/* Respond to the signal of autologin changing to see if the - setting for timed login changes. */ -static void -gdm_settings_change (DBusGProxy * proxy, const gchar * value, const gchar * old, const gchar * new, gpointer data) -{ - if (g_strcmp0(value, gdm_auto_login_string)) { - /* This is not a setting that we care about, - there is only one. */ - return; - } - g_debug("GDM Settings change: %s", new); - - if (g_strcmp0(new, "true") == 0) { - gdm_auto_login = TRUE; - } else { - gdm_auto_login = FALSE; - } - - if (gdm_autologin_cb != NULL) { - gdm_autologin_cb(); - } - - return; -} - -/* Get back the data from querying to see if there is auto - login enabled in GDM */ -static void -gdm_get_autologin (DBusGProxy * proxy, DBusGProxyCall * call, gpointer data) -{ - GError * error = NULL; - gchar * value = NULL; - - if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_STRING, &value, G_TYPE_INVALID)) { - g_warning("Unable to get autologin setting: %s", error != NULL ? error->message : "null"); - g_error_free(error); - return; - } - - g_return_if_fail(value != NULL); - gdm_settings_change(proxy, gdm_auto_login_string, NULL, value, NULL); - - return; -} - -/* Sets up the proxy and queries for the setting to know - whether we're doing an autologin. */ -static void -build_gdm_proxy (void) -{ - g_return_if_fail(gdm_settings_proxy == NULL); - - /* Grab the system bus */ - DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); - g_return_if_fail(bus != NULL); - - /* Get the settings proxy */ - gdm_settings_proxy = dbus_g_proxy_new_for_name_owner(bus, - "org.gnome.DisplayManager", - "/org/gnome/DisplayManager/Settings", - "org.gnome.DisplayManager.Settings", NULL); - g_return_if_fail(gdm_settings_proxy != NULL); - - /* Signal for value changed */ - dbus_g_proxy_add_signal(gdm_settings_proxy, - "ValueChanged", - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(gdm_settings_proxy, - "ValueChanged", - G_CALLBACK(gdm_settings_change), - NULL, - NULL); - - /* Start to get the initial value */ - dbus_g_proxy_begin_call(gdm_settings_proxy, - "GetValue", - gdm_get_autologin, - NULL, - NULL, - G_TYPE_STRING, - gdm_auto_login_string, - G_TYPE_INVALID); - - return; -} - /* When the screensave go active, if we've got a mainloop running we should quit it. */ static void @@ -247,17 +143,19 @@ void build_gss_proxy (void) { - DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); - g_return_if_fail(session_bus != NULL); - - gss_proxy = dbus_g_proxy_new_for_name(session_bus, - "org.gnome.ScreenSaver", - "/", - "org.gnome.ScreenSaver"); - g_return_if_fail(gss_proxy != NULL); + if (gss_proxy == NULL) { + DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + g_return_if_fail(session_bus != NULL); + + gss_proxy = dbus_g_proxy_new_for_name(session_bus, + "org.gnome.ScreenSaver", + "/", + "org.gnome.ScreenSaver"); + g_return_if_fail(gss_proxy != NULL); - dbus_g_proxy_add_signal(gss_proxy, "ActiveChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(gss_proxy, "ActiveChanged", G_CALLBACK(gss_active_changed), NULL, NULL); + dbus_g_proxy_add_signal(gss_proxy, "ActiveChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(gss_proxy, "ActiveChanged", G_CALLBACK(gss_active_changed), NULL, NULL); + } return; } @@ -288,6 +186,7 @@ return; } + build_gss_proxy(); g_return_if_fail(gss_proxy != NULL); dbus_g_proxy_call_no_reply(gss_proxy, @@ -319,9 +218,6 @@ is_guest = TRUE; } - build_gdm_proxy(); - build_gss_proxy(); - return FALSE; } diff -Nru indicator-session-0.2.1/src/lock-helper.h indicator-session-0.2.2/src/lock-helper.h --- indicator-session-0.2.1/src/lock-helper.h 2010-02-05 00:55:34.000000000 +0000 +++ indicator-session-0.2.2/src/lock-helper.h 2010-02-08 22:46:18.000000000 +0000 @@ -24,14 +24,11 @@ #include -typedef void (*gdm_autologin_cb_t) (void); - void screensaver_throttle (gchar * reason); void screensaver_unthrottle (void); gboolean will_lock_screen (void); void lock_screen (DbusmenuMenuitem * mi, guint timestamp, gpointer data); gboolean lock_screen_setup (gpointer data); -void lock_screen_gdm_cb_set (gdm_autologin_cb_t cb); #endif /* LOCK_HELPER_H__ */ diff -Nru indicator-session-0.2.1/src/Makefile.in indicator-session-0.2.2/src/Makefile.in --- indicator-session-0.2.1/src/Makefile.in 2010-02-05 01:14:59.000000000 +0000 +++ indicator-session-0.2.2/src/Makefile.in 2010-02-11 16:43:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -619,7 +619,7 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -644,7 +644,7 @@ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ diff -Nru indicator-session-0.2.1/src/session-service.c indicator-session-0.2.2/src/session-service.c --- indicator-session-0.2.1/src/session-service.c 2010-02-05 00:58:02.000000000 +0000 +++ indicator-session-0.2.2/src/session-service.c 2010-02-08 22:46:18.000000000 +0000 @@ -50,6 +50,9 @@ #define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch" +#define LOCKDOWN_DIR "/desktop/gnome/lockdown" +#define LOCKDOWN_KEY LOCKDOWN_DIR "/disable_user_switching" + typedef struct _ActivateData ActivateData; struct _ActivateData { @@ -62,6 +65,7 @@ static UsersServiceDbus *dbus_interface = NULL; static DbusmenuMenuitem *lock_menuitem = NULL; +static DbusmenuMenuitem *switch_menuitem = NULL; static gint count; static GList *users; @@ -80,6 +84,53 @@ static DbusmenuMenuitem * restart_mi = NULL; static DbusmenuMenuitem * shutdown_mi = NULL; +static GConfClient * gconf_client = NULL; +static guint notify_lockdown_id = 0; + +static void +lockdown_changed (GConfClient *client, + guint cnxd_id, + GConfEntry *entry, + gpointer user_data) +{ + GConfValue *value = gconf_entry_get_value (entry); + const gchar *key = gconf_entry_get_key (entry); + + if (!value || !key) + return; + + if (g_strcmp0 (key, LOCKDOWN_KEY) == 0) + { + if (switch_menuitem) + { + if (gconf_value_get_bool (value)) + { + dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + } + else + { + dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + } + } + } +} + +static void +ensure_gconf_client (void) +{ + if (!gconf_client) + { + gconf_client = gconf_client_get_default (); + + notify_lockdown_id = gconf_client_notify_add (gconf_client, + LOCKDOWN_KEY, + lockdown_changed, + NULL, + NULL, + NULL); + } +} + /* A return from the command to sleep the system. Make sure that we unthrottle the screensaver. */ static void @@ -264,20 +315,6 @@ return; } -/* Respond to the signal of autologin changing to see if the - setting for timed login changes. */ -static void -gdm_settings_change (void) -{ - if (!will_lock_screen()) { - dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); - } else { - dbusmenu_menuitem_property_set_bool(lock_menuitem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); - } - - return; -} - /* Checks to see if we should show the guest suession item */ static gboolean check_guest_session (void) @@ -441,13 +478,24 @@ if (check_new_session ()) { - mi = dbusmenu_menuitem_new (); - dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User...")); - dbusmenu_menuitem_child_append (root, mi); - g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL); + ensure_gconf_client (); + + switch_menuitem = dbusmenu_menuitem_new (); + dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User...")); + dbusmenu_menuitem_child_append (root, switch_menuitem); + g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL); + + if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY, NULL)) + { + dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + } + else + { + dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + } } } - + DbusmenuMenuitem * separator = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); dbusmenu_menuitem_child_append(root, separator); @@ -574,7 +622,6 @@ G_CALLBACK(service_shutdown), NULL); g_idle_add(lock_screen_setup, NULL); - lock_screen_gdm_cb_set(gdm_settings_change); root_menuitem = dbusmenu_menuitem_new(); g_debug("Root ID: %d", dbusmenu_menuitem_get_id(root_menuitem)); diff -Nru indicator-session-0.2.1/src/users-service-dbus.c indicator-session-0.2.2/src/users-service-dbus.c --- indicator-session-0.2.1/src/users-service-dbus.c 2010-02-03 00:19:48.000000000 +0000 +++ indicator-session-0.2.2/src/users-service-dbus.c 2010-02-10 03:33:49.000000000 +0000 @@ -443,37 +443,6 @@ return TRUE; } -static gchar * -get_session_for_user (UsersServiceDbus *service, - UserData *user) -{ - GList *l; - - if (!users_service_dbus_can_activate_session (service)) - { - return NULL; - } - - if (!user->sessions || g_list_length (user->sessions) == 0) - { - return NULL; - } - - for (l = user->sessions; l != NULL; l = l->next) - { - const char *ssid; - - ssid = l->data; - - if (ssid) - { - return g_strdup (ssid); - } - } - - return NULL; -} - static gboolean do_add_session (UsersServiceDbus *service, UserData *user, @@ -1035,17 +1004,6 @@ return g_hash_table_get_values (priv->users); } -/* - * XXX - TODO: Right now we switch to a session that another user - * already has open, but if there are no open sessions - * for this user we go to the login screen and the - * user at the seat must select a user and enter a - * password. This kind of defeats the purpose of - * actually selecting a username, since selecting any - * user will do the same thing here. We need to change - * it so you only need to enter a password for the - * specified user. - */ gboolean users_service_dbus_activate_user_session (UsersServiceDbus *self, UserData *user) @@ -1054,32 +1012,20 @@ DBusMessage *message = NULL; DBusMessage *reply = NULL; DBusError error; - gchar *ssid; dbus_error_init (&error); - if (!priv->seat) - priv->seat = get_seat (self); - - ssid = get_session_for_user (self, user); - - if (!ssid) - { - return start_new_user_session (self, user); - } - - if (!(message = dbus_message_new_method_call ("org.freedesktop.ConsoleKit", - priv->seat, - "org.freedesktop.ConsoleKit.Seat", - "ActivateSession"))) + if (!(message = dbus_message_new_method_call ("org.gnome.DisplayManager", + "/org/gnome/DisplayManager/LocalDisplayFactory", + "org.gnome.DisplayManager.LocalDisplayFactory", + "SwitchToUser"))) { g_warning ("failed to create new message"); return FALSE; } if (!dbus_message_append_args (message, - DBUS_TYPE_OBJECT_PATH, - &ssid, + DBUS_TYPE_STRING, &user->user_name, DBUS_TYPE_INVALID)) { g_warning ("failed to append args"); @@ -1110,6 +1056,8 @@ dbus_message_unref (reply); } + dbus_error_free (&error); + return TRUE; } diff -Nru indicator-session-0.2.1/src/users-service-dbus.h indicator-session-0.2.2/src/users-service-dbus.h --- indicator-session-0.2.1/src/users-service-dbus.h 2010-02-03 00:19:48.000000000 +0000 +++ indicator-session-0.2.2/src/users-service-dbus.h 2010-02-10 03:33:49.000000000 +0000 @@ -54,7 +54,7 @@ * got some gdm issues worked out. */ #define MINIMUM_USERS 1 -#define MAXIMUM_USERS 1 +#define MAXIMUM_USERS 7 struct _UsersServiceDbus { GObject parent;