summaryrefslogtreecommitdiff
diff options
authorRobert Ancell <[email protected]>2011-07-26 19:24:33 +1000
committergit-ubuntu importer <[email protected]>2011-07-26 09:30:11 +0000
commit1be792244ab512d487fe2eee3c2c5aaabb3794b5 (patch)
tree55c696a7b719dfe494b38984e1b16d5254a04eb5
parent89d2cfc86d1e361db906c7666f63dd0a5a7f6f49 (diff)
parent3c5cab378682909c774f619cde8a22a5a0367cf1 (diff)
0.0.2-0ubuntu1 (patches applied)applied/0.0.2-0ubuntu1
Imported using git-ubuntu import.
-rw-r--r--Makefile.in4
-rw-r--r--NEWS11
-rw-r--r--TODO1
-rwxr-xr-xconfigure55
-rw-r--r--configure.ac14
-rw-r--r--data/Makefile.am7
-rw-r--r--data/Makefile.in76
-rw-r--r--data/index.theme5
-rw-r--r--data/unity-greeter.conf17
-rw-r--r--data/unity-greeter.desktop6
-rw-r--r--debian/changelog10
-rw-r--r--debian/control2
-rw-r--r--debian/copyright6
-rw-r--r--src/Makefile.am11
-rw-r--r--src/Makefile.in65
-rw-r--r--src/config.vapi1
-rw-r--r--src/fixes.vapi11
-rw-r--r--src/unity-greeter.c753
-rw-r--r--src/unity-greeter.vala242
-rw-r--r--src/user-list.c234
-rw-r--r--src/user-list.vala50
21 files changed, 1093 insertions, 488 deletions
diff --git a/Makefile.in b/Makefile.in
index df1e4cc9..924302b0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,7 +35,7 @@ subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
- compile depcomp install-sh missing
+ TODO compile depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -126,7 +126,6 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
-GREETER_DIR = @GREETER_DIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -160,7 +159,6 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
-THEME_DIR = @THEME_DIR@
UNITY_GREETER_CFLAGS = @UNITY_GREETER_CFLAGS@
UNITY_GREETER_LIBS = @UNITY_GREETER_LIBS@
USE_NLS = @USE_NLS@
diff --git a/NEWS b/NEWS
index e69de29b..24b0acc3 100644
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1,11 @@
+Overview of changes in lightdm 0.0.2
+
+ * Add copyright headers to .vala files
+ * Update to work with LightDM 0.9
+ * Add a config file and load Ambiance theme
+ * Fit to primary monitor
+ * Set root background
+
+Overview of changes in lightdm 0.0.1
+
+ * Initial release
diff --git a/TODO b/TODO
new file mode 100644
index 00000000..42f8f8ad
--- /dev/null
+++ b/TODO
@@ -0,0 +1 @@
+Use ConsoleKit to see who is logged in \ No newline at end of file
diff --git a/configure b/configure
index a18cb62b..6182892f 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for unity-greeter 0.0.1.
+# Generated by GNU Autoconf 2.68 for unity-greeter 0.0.2.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -616,8 +616,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='unity-greeter'
PACKAGE_TARNAME='unity-greeter'
-PACKAGE_VERSION='0.0.1'
-PACKAGE_STRING='unity-greeter 0.0.1'
+PACKAGE_VERSION='0.0.2'
+PACKAGE_STRING='unity-greeter 0.0.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -655,8 +655,6 @@ INTLTOOL_EXTRACT
INTLTOOL_MERGE
INTLTOOL_UPDATE
USE_NLS
-GREETER_DIR
-THEME_DIR
UNITY_GREETER_LIBS
UNITY_GREETER_CFLAGS
PKG_CONFIG_LIBDIR
@@ -1311,7 +1309,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures unity-greeter 0.0.1 to adapt to many kinds of systems.
+\`configure' configures unity-greeter 0.0.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1377,7 +1375,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of unity-greeter 0.0.1:";;
+ short | recursive ) echo "Configuration of unity-greeter 0.0.2:";;
esac
cat <<\_ACEOF
@@ -1480,7 +1478,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-unity-greeter configure 0.0.1
+unity-greeter configure 0.0.2
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1648,7 +1646,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by unity-greeter $as_me 0.0.1, which was
+It was created by unity-greeter $as_me 0.0.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2464,7 +2462,7 @@ fi
# Define the identity of the package.
PACKAGE='unity-greeter'
- VERSION='0.0.1'
+ VERSION='0.0.2'
cat >>confdefs.h <<_ACEOF
@@ -3955,21 +3953,24 @@ if test -n "$UNITY_GREETER_CFLAGS"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
\""; } >&5
($PKG_CONFIG --exists --print-errors "
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_UNITY_GREETER_CFLAGS=`$PKG_CONFIG --cflags "
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
@@ -3984,21 +3985,24 @@ if test -n "$UNITY_GREETER_LIBS"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
\""; } >&5
($PKG_CONFIG --exists --print-errors "
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_UNITY_GREETER_LIBS=`$PKG_CONFIG --libs "
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
@@ -4022,14 +4026,16 @@ fi
if test $_pkg_short_errors_supported = yes; then
UNITY_GREETER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
" 2>&1`
else
UNITY_GREETER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@@ -4037,8 +4043,9 @@ fi
as_fn_error $? "Package requirements (
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
) were not met:
$UNITY_GREETER_PKG_ERRORS
@@ -4072,12 +4079,6 @@ $as_echo "yes" >&6; }
fi
-THEME_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=themedir liblightdm-gobject-0`
-
-
-GREETER_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=greeterdir liblightdm-gobject-0`
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
@@ -5189,7 +5190,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by unity-greeter $as_me 0.0.1, which was
+This file was extended by unity-greeter $as_me 0.0.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5255,7 +5256,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-unity-greeter config.status 0.0.1
+unity-greeter config.status 0.0.2
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index a4d51767..1bea64bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(unity-greeter, 0.0.1)
+AC_INIT(unity-greeter, 0.0.2)
AC_CONFIG_MACRO_DIR(m4)
AM_INIT_AUTOMAKE
AM_PROG_CC_C_O
@@ -17,20 +17,12 @@ dnl ###########################################################################
PKG_CHECK_MODULES(UNITY_GREETER, [
gtk+-3.0
+ gdk-x11-3.0
indicator3-0.4
- liblightdm-gobject-0 >= 0.4.3
+ liblightdm-gobject-1 >= 0.9.2
])
dnl ###########################################################################
-dnl Configurable values
-dnl ###########################################################################
-THEME_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=themedir liblightdm-gobject-0`
-AC_SUBST(THEME_DIR)
-
-GREETER_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=greeterdir liblightdm-gobject-0`
-AC_SUBST(GREETER_DIR)
-
-dnl ###########################################################################
dnl Internationalization
dnl ###########################################################################
diff --git a/data/Makefile.am b/data/Makefile.am
index ecc02cf4..2d573b5b 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,5 +1,8 @@
-dist_theme_DATA = index.theme
-themedir = $(THEME_DIR)/unity
+dist_xgreeter_DATA = unity-greeter.desktop
+xgreeterdir = $(datarootdir)/xgreeters
+
+configdir = $(sysconfdir)/lightdm
+dist_config_DATA = unity-greeter.conf
DISTCLEANFILES = \
Makefile.in
diff --git a/data/Makefile.in b/data/Makefile.in
index c2feaa5e..868196ed 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -33,8 +33,8 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = data
-DIST_COMMON = $(dist_theme_DATA) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in
+DIST_COMMON = $(dist_config_DATA) $(dist_xgreeter_DATA) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -72,8 +72,8 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(themedir)"
-DATA = $(dist_theme_DATA)
+am__installdirs = "$(DESTDIR)$(configdir)" "$(DESTDIR)$(xgreeterdir)"
+DATA = $(dist_config_DATA) $(dist_xgreeter_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
@@ -96,7 +96,6 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
-GREETER_DIR = @GREETER_DIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -130,7 +129,6 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
-THEME_DIR = @THEME_DIR@
UNITY_GREETER_CFLAGS = @UNITY_GREETER_CFLAGS@
UNITY_GREETER_LIBS = @UNITY_GREETER_LIBS@
USE_NLS = @USE_NLS@
@@ -180,8 +178,10 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-dist_theme_DATA = index.theme
-themedir = $(THEME_DIR)/unity
+dist_xgreeter_DATA = unity-greeter.desktop
+xgreeterdir = $(datarootdir)/xgreeters
+configdir = $(sysconfdir)/lightdm
+dist_config_DATA = unity-greeter.conf
DISTCLEANFILES = \
Makefile.in
@@ -218,26 +218,46 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-install-dist_themeDATA: $(dist_theme_DATA)
+install-dist_configDATA: $(dist_config_DATA)
@$(NORMAL_INSTALL)
- test -z "$(themedir)" || $(MKDIR_P) "$(DESTDIR)$(themedir)"
- @list='$(dist_theme_DATA)'; test -n "$(themedir)" || list=; \
+ test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)"
+ @list='$(dist_config_DATA)'; test -n "$(configdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(themedir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(themedir)" || exit $$?; \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(configdir)" || exit $$?; \
done
-uninstall-dist_themeDATA:
+uninstall-dist_configDATA:
@$(NORMAL_UNINSTALL)
- @list='$(dist_theme_DATA)'; test -n "$(themedir)" || list=; \
+ @list='$(dist_config_DATA)'; test -n "$(configdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(themedir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(themedir)" && rm -f $$files
+ echo " ( cd '$(DESTDIR)$(configdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(configdir)" && rm -f $$files
+install-dist_xgreeterDATA: $(dist_xgreeter_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(xgreeterdir)" || $(MKDIR_P) "$(DESTDIR)$(xgreeterdir)"
+ @list='$(dist_xgreeter_DATA)'; test -n "$(xgreeterdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xgreeterdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(xgreeterdir)" || exit $$?; \
+ done
+
+uninstall-dist_xgreeterDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_xgreeter_DATA)'; test -n "$(xgreeterdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(xgreeterdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(xgreeterdir)" && rm -f $$files
tags: TAGS
TAGS:
@@ -279,7 +299,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(themedir)"; do \
+ for dir in "$(DESTDIR)$(configdir)" "$(DESTDIR)$(xgreeterdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -328,7 +348,7 @@ info: info-am
info-am:
-install-data-am: install-dist_themeDATA
+install-data-am: install-dist_configDATA install-dist_xgreeterDATA
install-dvi: install-dvi-am
@@ -372,21 +392,21 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-dist_themeDATA
+uninstall-am: uninstall-dist_configDATA uninstall-dist_xgreeterDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \
- install-dist_themeDATA install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am uninstall uninstall-am \
- uninstall-dist_themeDATA
+ install-dist_configDATA install-dist_xgreeterDATA install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-dist_configDATA uninstall-dist_xgreeterDATA
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/data/index.theme b/data/index.theme
deleted file mode 100644
index bde3f20c..00000000
--- a/data/index.theme
+++ /dev/null
@@ -1,5 +0,0 @@
-[theme]
-name=Unity
-description=Unity Greeter
-engine=unity-greeter
-session=gnome
diff --git a/data/unity-greeter.conf b/data/unity-greeter.conf
new file mode 100644
index 00000000..c096de99
--- /dev/null
+++ b/data/unity-greeter.conf
@@ -0,0 +1,17 @@
+#
+# background = Background file to use, either an image path or a color (e.g. #772953)
+# theme-name = GTK+ theme to use
+# font-name = Font to use
+# xft-antialias = Whether to antialias Xft fonts (true or false)
+# xft-dpi = Resolution for Xft in dots per inch (e.g. 96)
+# xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)
+# xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)
+#
+[greeter]
+background=/usr/share/backgrounds/warty-final-ubuntu.png
+theme-name=Ambiance
+font-name=Ubuntu 11
+xft-antialias=true
+xft-dpi=96
+xft-hintstyle=hintslight
+xft-rgba=rgb
diff --git a/data/unity-greeter.desktop b/data/unity-greeter.desktop
new file mode 100644
index 00000000..c1063cc1
--- /dev/null
+++ b/data/unity-greeter.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=Unity Greeter
+Comment=Unity Greeter
+Exec=unity-greeter
+Type=Application
+X-Ubuntu-Gettext-Domain=unity-greeter
diff --git a/debian/changelog b/debian/changelog
index 0ed39064..1cc7051c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+unity-greeter (0.0.2-0ubuntu1) oneiric; urgency=low
+
+ * New upstream release
+ * debian/control:
+ - Use liblightdm-gobject-1
+ * debian/copyright:
+ - Update copyright format to latest
+
+ -- Robert Ancell <[email protected]> Tue, 26 Jul 2011 19:24:33 +1000
+
unity-greeter (0.0.1-0ubuntu1) oneiric; urgency=low
* New upstream release
diff --git a/debian/control b/debian/control
index 86473dec..7913cee2 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 7.0.50~),
dh-autoreconf,
gnome-common,
valac,
- liblightdm-gobject-0-dev (>= 0.4.3),
+ liblightdm-gobject-1-dev (>= 0.9.2),
libgtk-3-dev,
libindicator3-dev
Homepage: https://launchpad.net/unity-greeter
diff --git a/debian/copyright b/debian/copyright
index 2476352a..d4aa415f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,4 @@
-Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59
-Name: Unity Greeter
-Maintainer: Robert Ancell <[email protected]>
+Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=174
Source: https://launchpad.net/unity-greeter
Files: *
@@ -17,5 +15,5 @@ License: GPL-3
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-X-Comment: On Debian systems, the complete text of the GNU General
+Comment: On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-3’.
diff --git a/src/Makefile.am b/src/Makefile.am
index d0881c22..88276bed 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,8 @@
-greeter_PROGRAMS = unity-greeter
-greeterdir = $(GREETER_DIR)
+sbin_PROGRAMS = unity-greeter
unity_greeter_SOURCES = \
config.vapi \
+ fixes.vapi \
indicator.vapi \
unity-greeter.vala \
user-list.vala
@@ -11,12 +11,15 @@ unity_greeter_CFLAGS = \
$(UNITY_GREETER_CFLAGS) \
$(WARN_CFLAGS) \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
- -DVERSION=\"$(VERSION)\"
+ -DVERSION=\"$(VERSION)\" \
+ -DCONFIG_FILE=\""$(sysconfdir)/lightdm/unity-greeter.conf"\"
unity_greeter_VALAFLAGS = \
--pkg posix \
--pkg gtk+-3.0 \
- --pkg liblightdm-gobject-0
+ --pkg gdk-x11-3.0 \
+ --pkg x11 \
+ --pkg liblightdm-gobject-1
unity_greeter_LDADD = \
$(UNITY_GREETER_LIBS)
diff --git a/src/Makefile.in b/src/Makefile.in
index c00a8328..601294bb 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -32,7 +32,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-greeter_PROGRAMS = unity-greeter$(EXEEXT)
+sbin_PROGRAMS = unity-greeter$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
unity-greeter.c unity_greeter_vala.stamp user-list.c
@@ -44,8 +44,8 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(greeterdir)"
-PROGRAMS = $(greeter_PROGRAMS)
+am__installdirs = "$(DESTDIR)$(sbindir)"
+PROGRAMS = $(sbin_PROGRAMS)
am_unity_greeter_OBJECTS = unity_greeter-unity-greeter.$(OBJEXT) \
unity_greeter-user-list.$(OBJEXT)
unity_greeter_OBJECTS = $(am_unity_greeter_OBJECTS)
@@ -106,7 +106,6 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
GMSGFMT = @GMSGFMT@
-GREETER_DIR = @GREETER_DIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -140,7 +139,6 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
-THEME_DIR = @THEME_DIR@
UNITY_GREETER_CFLAGS = @UNITY_GREETER_CFLAGS@
UNITY_GREETER_LIBS = @UNITY_GREETER_LIBS@
USE_NLS = @USE_NLS@
@@ -190,9 +188,9 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-greeterdir = $(GREETER_DIR)
unity_greeter_SOURCES = \
config.vapi \
+ fixes.vapi \
indicator.vapi \
unity-greeter.vala \
user-list.vala
@@ -201,12 +199,15 @@ unity_greeter_CFLAGS = \
$(UNITY_GREETER_CFLAGS) \
$(WARN_CFLAGS) \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
- -DVERSION=\"$(VERSION)\"
+ -DVERSION=\"$(VERSION)\" \
+ -DCONFIG_FILE=\""$(sysconfdir)/lightdm/unity-greeter.conf"\"
unity_greeter_VALAFLAGS = \
--pkg posix \
--pkg gtk+-3.0 \
- --pkg liblightdm-gobject-0
+ --pkg gdk-x11-3.0 \
+ --pkg x11 \
+ --pkg liblightdm-gobject-1
unity_greeter_LDADD = \
$(UNITY_GREETER_LIBS)
@@ -248,10 +249,10 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-install-greeterPROGRAMS: $(greeter_PROGRAMS)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(greeterdir)" || $(MKDIR_P) "$(DESTDIR)$(greeterdir)"
- @list='$(greeter_PROGRAMS)'; test -n "$(greeterdir)" || list=; \
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p; \
@@ -268,23 +269,23 @@ install-greeterPROGRAMS: $(greeter_PROGRAMS)
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(greeterdir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(greeterdir)$$dir" || exit $$?; \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
} \
; done
-uninstall-greeterPROGRAMS:
+uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(greeter_PROGRAMS)'; test -n "$(greeterdir)" || list=; \
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(greeterdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(greeterdir)" && rm -f $$files
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
-clean-greeterPROGRAMS:
- -test -z "$(greeter_PROGRAMS)" || rm -f $(greeter_PROGRAMS)
+clean-sbinPROGRAMS:
+ -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
unity-greeter$(EXEEXT): $(unity_greeter_OBJECTS) $(unity_greeter_DEPENDENCIES)
@rm -f unity-greeter$(EXEEXT)
$(AM_V_CCLD)$(unity_greeter_LINK) $(unity_greeter_OBJECTS) $(unity_greeter_LDADD) $(LIBS)
@@ -445,7 +446,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
- for dir in "$(DESTDIR)$(greeterdir)"; do \
+ for dir in "$(DESTDIR)$(sbindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -479,7 +480,7 @@ maintainer-clean-generic:
-rm -f user-list.c
clean: clean-am
-clean-am: clean-generic clean-greeterPROGRAMS mostlyclean-am
+clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -499,13 +500,13 @@ info: info-am
info-am:
-install-data-am: install-greeterPROGRAMS
+install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am:
+install-exec-am: install-sbinPROGRAMS
install-html: install-html-am
@@ -544,22 +545,22 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-greeterPROGRAMS
+uninstall-am: uninstall-sbinPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-greeterPROGRAMS ctags distclean distclean-compile \
+ clean-sbinPROGRAMS ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-greeterPROGRAMS install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-greeterPROGRAMS
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-sbinPROGRAMS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-sbinPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/config.vapi b/src/config.vapi
index 4ed687d0..d10c1ea3 100644
--- a/src/config.vapi
+++ b/src/config.vapi
@@ -3,4 +3,5 @@ namespace Config
{
public const string GETTEXT_PACKAGE;
public const string VERSION;
+ public const string CONFIG_FILE;
}
diff --git a/src/fixes.vapi b/src/fixes.vapi
new file mode 100644
index 00000000..1d34aa1f
--- /dev/null
+++ b/src/fixes.vapi
@@ -0,0 +1,11 @@
+[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "X11/Xlib.h")]
+namespace X
+{
+ [CCode (cname = "XCreatePixmap")]
+ public int CreatePixmap (X.Display display, X.Drawable d, uint width, uint height, uint depth);
+ [CCode (cname = "XSetWindowBackgroundPixmap")]
+ public int SetWindowBackgroundPixmap (X.Display display, X.Window w, int Pixmap);
+ [CCode (cname = "XClearWindow")]
+ public int ClearWindow (X.Display display, X.Window w);
+ public const int RetainPermanent;
+} \ No newline at end of file
diff --git a/src/unity-greeter.c b/src/unity-greeter.c
index 7991c5c0..126761e0 100644
--- a/src/unity-greeter.c
+++ b/src/unity-greeter.c
@@ -1,16 +1,42 @@
/* unity-greeter.c generated by valac 0.13.0, the Vala compiler
* generated from unity-greeter.vala, do not modify */
+/*
+ * Copyright (C) 2011 Canonical Ltd
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authored by: Robert Ancell <[email protected]>
+ */
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
-#include <lightdm/greeter.h>
+#include <lightdm.h>
#include <stdlib.h>
#include <string.h>
+#include <cairo.h>
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include <X11/Xregion.h>
+#include <gdk/gdkx.h>
+#include <cairo-xlib.h>
#include <stdio.h>
+#include <float.h>
+#include <math.h>
#include <gobject/gvaluecollector.h>
@@ -37,7 +63,13 @@ typedef struct _UserListClass UserListClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+typedef struct _UserListPrivate UserListPrivate;
+#define _cairo_pattern_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_pattern_destroy (var), NULL)))
+#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
+#define _XCloseDisplay0(var) ((var == NULL) ? NULL : (var = (XCloseDisplay (var), NULL)))
+#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
+#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
#define _unity_greeter_unref0(var) ((var == NULL) ? NULL : (var = (unity_greeter_unref (var), NULL)))
typedef struct _ParamSpecUnityGreeter ParamSpecUnityGreeter;
@@ -45,7 +77,6 @@ struct _UnityGreeter {
GTypeInstance parent_instance;
volatile int ref_count;
UnityGreeterPrivate * priv;
- UserList* user_list;
};
struct _UnityGreeterClass {
@@ -54,13 +85,24 @@ struct _UnityGreeterClass {
};
struct _UnityGreeterPrivate {
+ UserList* user_list;
GtkWindow* main_window;
- LdmGreeter* greeter;
+ LightDMGreeter* greeter;
gboolean prompted;
gchar* test_username;
gboolean test_is_authenticated;
};
+struct _UserList {
+ GtkContainer parent_instance;
+ UserListPrivate * priv;
+ gchar* default_background;
+};
+
+struct _UserListClass {
+ GtkContainerClass parent_class;
+};
+
struct _ParamSpecUnityGreeter {
GParamSpec parent_instance;
};
@@ -71,6 +113,10 @@ static gboolean unity_greeter_show_version;
static gboolean unity_greeter_show_version = FALSE;
static gboolean unity_greeter_test_mode;
static gboolean unity_greeter_test_mode = FALSE;
+static GKeyFile* unity_greeter_config;
+static GKeyFile* unity_greeter_config = NULL;
+static cairo_surface_t* unity_greeter_background_surface;
+static cairo_surface_t* unity_greeter_background_surface = NULL;
gpointer unity_greeter_ref (gpointer instance);
void unity_greeter_unref (gpointer instance);
@@ -86,16 +132,12 @@ enum {
};
UnityGreeter* unity_greeter_new (void);
UnityGreeter* unity_greeter_construct (GType object_type);
-static void unity_greeter_connected_cb (UnityGreeter* self);
-static void _unity_greeter_connected_cb_ldm_greeter_connected (LdmGreeter* _sender, gpointer self);
-static void unity_greeter_show_message_cb (UnityGreeter* self, const gchar* text, LdmMessageType type);
-static void _unity_greeter_show_message_cb_ldm_greeter_show_message (LdmGreeter* _sender, const gchar* text, LdmMessageType type, gpointer self);
-static void unity_greeter_show_prompt_cb (UnityGreeter* self, const gchar* text, LdmPromptType type);
-static void _unity_greeter_show_prompt_cb_ldm_greeter_show_prompt (LdmGreeter* _sender, const gchar* text, LdmPromptType type, gpointer self);
+static void unity_greeter_show_message_cb (UnityGreeter* self, const gchar* text, LightDMMessageType type);
+static void _unity_greeter_show_message_cb_lightdm_greeter_show_message (LightDMGreeter* _sender, const gchar* text, LightDMMessageType type, gpointer self);
+static void unity_greeter_show_prompt_cb (UnityGreeter* self, const gchar* text, LightDMPromptType type);
+static void _unity_greeter_show_prompt_cb_lightdm_greeter_show_prompt (LightDMGreeter* _sender, const gchar* text, LightDMPromptType type, gpointer self);
static void unity_greeter_authentication_complete_cb (UnityGreeter* self);
-static void _unity_greeter_authentication_complete_cb_ldm_greeter_authentication_complete (LdmGreeter* _sender, gpointer self);
-static void unity_greeter_quit_cb (UnityGreeter* self);
-static void _unity_greeter_quit_cb_ldm_greeter_quit (LdmGreeter* _sender, gpointer self);
+static void _unity_greeter_authentication_complete_cb_lightdm_greeter_authentication_complete (LightDMGreeter* _sender, gpointer self);
UserList* user_list_new (void);
UserList* user_list_construct (GType object_type);
static void unity_greeter_user_selected_cb (UnityGreeter* self, const gchar* username);
@@ -104,49 +146,41 @@ static void unity_greeter_respond_to_prompt_cb (UnityGreeter* self, const gchar*
static void _unity_greeter_respond_to_prompt_cb_user_list_respond_to_prompt (UserList* _sender, const gchar* text, gpointer self);
static void unity_greeter_start_session_cb (UnityGreeter* self);
static void _unity_greeter_start_session_cb_user_list_start_session (UserList* _sender, gpointer self);
-void user_list_add_entry (UserList* self, const gchar* name, const gchar* label, const gchar* background, gboolean is_active);
+gchar* unity_greeter_get_config_value (const gchar* group_name, const gchar* key, const gchar* _default_);
void user_list_add_session (UserList* self, const gchar* name, const gchar* label);
+void user_list_add_entry (UserList* self, const gchar* name, const gchar* label, const gchar* background, gboolean is_active);
void user_list_set_session (UserList* self, const gchar* value);
void unity_greeter_show (UnityGreeter* self);
void user_list_show_prompt (UserList* self, const gchar* text, gboolean secret);
-static gboolean unity_greeter_test_quit_cb (UnityGreeter* self);
void user_list_login_complete (UserList* self);
-static gboolean _unity_greeter_test_quit_cb_gsource_func (gpointer self);
+cairo_pattern_t* user_list_get_background (UserList* self);
+static void unity_greeter_refresh_background (UnityGreeter* self, GdkScreen* screen);
const gchar* user_list_get_session (UserList* self);
void user_list_show_authenticated (UserList* self);
void user_list_set_error (UserList* self, const gchar* text);
static void unity_greeter_start_authentication (UnityGreeter* self);
const gchar* user_list_get_selected (UserList* self);
+static cairo_surface_t* unity_greeter_create_root_surface (GdkScreen* screen);
gint unity_greeter_main (gchar** args, int args_length1);
static void unity_greeter_finalize (UnityGreeter* obj);
const GOptionEntry UNITY_GREETER_options[3] = {{"version", 'v', 0, G_OPTION_ARG_NONE, &unity_greeter_show_version, "Show release version", NULL}, {"test-mode", (gchar) 0, 0, G_OPTION_ARG_NONE, &unity_greeter_test_mode, "Run in test mode", NULL}, {NULL}};
-static void _unity_greeter_connected_cb_ldm_greeter_connected (LdmGreeter* _sender, gpointer self) {
- unity_greeter_connected_cb (self);
-}
-
-
-static void _unity_greeter_show_message_cb_ldm_greeter_show_message (LdmGreeter* _sender, const gchar* text, LdmMessageType type, gpointer self) {
+static void _unity_greeter_show_message_cb_lightdm_greeter_show_message (LightDMGreeter* _sender, const gchar* text, LightDMMessageType type, gpointer self) {
unity_greeter_show_message_cb (self, text, type);
}
-static void _unity_greeter_show_prompt_cb_ldm_greeter_show_prompt (LdmGreeter* _sender, const gchar* text, LdmPromptType type, gpointer self) {
+static void _unity_greeter_show_prompt_cb_lightdm_greeter_show_prompt (LightDMGreeter* _sender, const gchar* text, LightDMPromptType type, gpointer self) {
unity_greeter_show_prompt_cb (self, text, type);
}
-static void _unity_greeter_authentication_complete_cb_ldm_greeter_authentication_complete (LdmGreeter* _sender, gpointer self) {
+static void _unity_greeter_authentication_complete_cb_lightdm_greeter_authentication_complete (LightDMGreeter* _sender, gpointer self) {
unity_greeter_authentication_complete_cb (self);
}
-static void _unity_greeter_quit_cb_ldm_greeter_quit (LdmGreeter* _sender, gpointer self) {
- unity_greeter_quit_cb (self);
-}
-
-
static void _unity_greeter_user_selected_cb_user_list_user_selected (UserList* _sender, const gchar* username, gpointer self) {
unity_greeter_user_selected_cb (self, username);
}
@@ -169,61 +203,147 @@ static gpointer _g_object_ref0 (gpointer self) {
UnityGreeter* unity_greeter_construct (GType object_type) {
UnityGreeter* self = NULL;
+ LightDMGreeter* _tmp0_ = NULL;
UserList* _tmp1_ = NULL;
- GtkWindow* _tmp2_ = NULL;
+ gchar* _tmp2_ = NULL;
+ GList* _tmp3_ = NULL;
+ GtkWindow* _tmp15_ = NULL;
+ GError * _inner_error_ = NULL;
self = (UnityGreeter*) g_type_create_instance (object_type);
+ _tmp0_ = lightdm_greeter_new ();
+ _g_object_unref0 (self->priv->greeter);
+ self->priv->greeter = _tmp0_;
+ g_signal_connect (self->priv->greeter, "show-message", (GCallback) _unity_greeter_show_message_cb_lightdm_greeter_show_message, self);
+ g_signal_connect (self->priv->greeter, "show-prompt", (GCallback) _unity_greeter_show_prompt_cb_lightdm_greeter_show_prompt, self);
+ g_signal_connect (self->priv->greeter, "authentication-complete", (GCallback) _unity_greeter_authentication_complete_cb_lightdm_greeter_authentication_complete, self);
if (!unity_greeter_test_mode) {
- LdmGreeter* _tmp0_ = NULL;
- _tmp0_ = ldm_greeter_new ();
- _g_object_unref0 (self->priv->greeter);
- self->priv->greeter = _tmp0_;
- g_signal_connect (self->priv->greeter, "connected", (GCallback) _unity_greeter_connected_cb_ldm_greeter_connected, self);
- g_signal_connect (self->priv->greeter, "show-message", (GCallback) _unity_greeter_show_message_cb_ldm_greeter_show_message, self);
- g_signal_connect (self->priv->greeter, "show-prompt", (GCallback) _unity_greeter_show_prompt_cb_ldm_greeter_show_prompt, self);
- g_signal_connect (self->priv->greeter, "authentication-complete", (GCallback) _unity_greeter_authentication_complete_cb_ldm_greeter_authentication_complete, self);
- g_signal_connect (self->priv->greeter, "quit", (GCallback) _unity_greeter_quit_cb_ldm_greeter_quit, self);
- ldm_greeter_connect_to_server (self->priv->greeter);
+ {
+ lightdm_greeter_connect_sync (self->priv->greeter, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ goto __catch0_g_error;
+ }
+ }
+ goto __finally0;
+ __catch0_g_error:
+ {
+ GError* e = NULL;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ g_warning ("unity-greeter.vala:61: Failed to connect to LightDM daemon");
+ exit (EXIT_FAILURE);
+ _g_error_free0 (e);
+ }
+ __finally0:
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return NULL;
+ }
}
_tmp1_ = user_list_new ();
- _g_object_unref0 (self->user_list);
- self->user_list = g_object_ref_sink (_tmp1_);
- g_signal_connect (self->user_list, "user-selected", (GCallback) _unity_greeter_user_selected_cb_user_list_user_selected, self);
- g_signal_connect (self->user_list, "respond-to-prompt", (GCallback) _unity_greeter_respond_to_prompt_cb_user_list_respond_to_prompt, self);
- g_signal_connect (self->user_list, "start-session", (GCallback) _unity_greeter_start_session_cb_user_list_start_session, self);
- gtk_widget_show ((GtkWidget*) self->user_list);
+ _g_object_unref0 (self->priv->user_list);
+ self->priv->user_list = g_object_ref_sink (_tmp1_);
+ g_signal_connect (self->priv->user_list, "user-selected", (GCallback) _unity_greeter_user_selected_cb_user_list_user_selected, self);
+ g_signal_connect (self->priv->user_list, "respond-to-prompt", (GCallback) _unity_greeter_respond_to_prompt_cb_user_list_respond_to_prompt, self);
+ g_signal_connect (self->priv->user_list, "start-session", (GCallback) _unity_greeter_start_session_cb_user_list_start_session, self);
+ _tmp2_ = unity_greeter_get_config_value ("greeter", "background", "#000000");
+ _g_free0 (self->priv->user_list->default_background);
+ self->priv->user_list->default_background = _tmp2_;
+ gtk_widget_show ((GtkWidget*) self->priv->user_list);
+ _tmp3_ = lightdm_get_sessions ();
+ {
+ GList* session_collection = NULL;
+ GList* session_it = NULL;
+ session_collection = _tmp3_;
+ for (session_it = session_collection; session_it != NULL; session_it = session_it->next) {
+ LightDMSession* session = NULL;
+ session = (LightDMSession*) session_it->data;
+ {
+ const gchar* _tmp4_ = NULL;
+ const gchar* _tmp5_ = NULL;
+ _tmp4_ = lightdm_session_get_key (session);
+ _tmp5_ = lightdm_session_get_name (session);
+ user_list_add_session (self->priv->user_list, _tmp4_, _tmp5_);
+ }
+ }
+ }
if (unity_greeter_test_mode) {
- user_list_add_entry (self->user_list, "alice", "Alice User", "/usr/share/backgrounds/Berries_by_Orb9220.jpg", TRUE);
- user_list_add_entry (self->user_list, "bob", "Bob User", "/usr/share/backgrounds/White_flowers_by_Garuna_bor-bor.jpg", FALSE);
- user_list_add_entry (self->user_list, "carol", "Carol User", "/usr/share/backgrounds/Bird_by_Magnus.jpg", FALSE);
- user_list_add_entry (self->user_list, "*guest", "Guest Account", NULL, TRUE);
- user_list_add_entry (self->user_list, NULL, "Other...", NULL, FALSE);
- user_list_add_session (self->user_list, "gnome", "Ubuntu");
- user_list_add_session (self->user_list, "gnome-shell", "GNOME");
- user_list_add_session (self->user_list, "kde", "KDE");
- user_list_set_session (self->user_list, "gnome");
- }
- _tmp2_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ user_list_add_entry (self->priv->user_list, "alice", "Alice User", "/usr/share/backgrounds/Berries_by_Orb9220.jpg", TRUE);
+ user_list_add_entry (self->priv->user_list, "bob", "Bob User", "/usr/share/backgrounds/White_flowers_by_Garuna_bor-bor.jpg", FALSE);
+ user_list_add_entry (self->priv->user_list, "carol", "Carol User", "/usr/share/backgrounds/Bird_by_Magnus.jpg", FALSE);
+ user_list_add_entry (self->priv->user_list, "*guest", "Guest Account", NULL, TRUE);
+ user_list_add_entry (self->priv->user_list, NULL, "Other...", NULL, FALSE);
+ user_list_add_session (self->priv->user_list, "gnome", "Ubuntu");
+ user_list_add_session (self->priv->user_list, "gnome-shell", "GNOME");
+ user_list_add_session (self->priv->user_list, "kde", "KDE");
+ user_list_set_session (self->priv->user_list, "gnome");
+ } else {
+ LightDMUserList* _tmp6_ = NULL;
+ GList* _tmp7_ = NULL;
+ gboolean _tmp14_;
+ _tmp6_ = lightdm_user_list_get_instance ();
+ _tmp7_ = lightdm_user_list_get_users (_tmp6_);
+ {
+ GList* user_collection = NULL;
+ GList* user_it = NULL;
+ user_collection = _tmp7_;
+ for (user_it = user_collection; user_it != NULL; user_it = user_it->next) {
+ LightDMUser* user = NULL;
+ user = (LightDMUser*) user_it->data;
+ {
+ const gchar* _tmp8_ = NULL;
+ gchar* _tmp9_;
+ gchar* label;
+ const gchar* _tmp10_ = NULL;
+ const gchar* _tmp13_ = NULL;
+ _tmp8_ = lightdm_user_get_real_name (user);
+ _tmp9_ = g_strdup (_tmp8_);
+ label = _tmp9_;
+ _tmp10_ = lightdm_user_get_real_name (user);
+ if (g_strcmp0 (_tmp10_, "") == 0) {
+ const gchar* _tmp11_ = NULL;
+ gchar* _tmp12_;
+ _tmp11_ = lightdm_user_get_name (user);
+ _tmp12_ = g_strdup (_tmp11_);
+ _g_free0 (label);
+ label = _tmp12_;
+ }
+ _tmp13_ = lightdm_user_get_name (user);
+ user_list_add_entry (self->priv->user_list, _tmp13_, label, NULL, FALSE);
+ _g_free0 (label);
+ }
+ }
+ }
+ _tmp14_ = lightdm_greeter_get_has_guest_account_hint (self->priv->greeter);
+ if (_tmp14_) {
+ user_list_add_entry (self->priv->user_list, "*guest", "Guest Account", NULL, FALSE);
+ }
+ user_list_add_entry (self->priv->user_list, NULL, "Other...", NULL, FALSE);
+ }
+ _tmp15_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
_g_object_unref0 (self->priv->main_window);
- self->priv->main_window = g_object_ref_sink (_tmp2_);
+ self->priv->main_window = g_object_ref_sink (_tmp15_);
+ gtk_window_set_has_resize_grip (self->priv->main_window, FALSE);
if (unity_greeter_test_mode) {
gtk_window_set_default_size (self->priv->main_window, 1024, 600);
} else {
- GdkDisplay* _tmp3_ = NULL;
- GdkScreen* _tmp4_ = NULL;
- GdkScreen* _tmp5_;
+ GdkScreen* _tmp16_ = NULL;
+ GdkScreen* _tmp17_;
GdkScreen* screen;
- gint _tmp6_;
- gint _tmp7_;
- _tmp3_ = gdk_display_get_default ();
- _tmp4_ = gdk_display_get_default_screen (_tmp3_);
- _tmp5_ = _g_object_ref0 (_tmp4_);
- screen = _tmp5_;
- _tmp6_ = gdk_screen_get_width (screen);
- _tmp7_ = gdk_screen_get_height (screen);
- gtk_window_set_default_size (self->priv->main_window, _tmp6_, _tmp7_);
+ GdkRectangle geometry = {0};
+ gint _tmp18_;
+ GdkRectangle _tmp19_ = {0};
+ _tmp16_ = gdk_screen_get_default ();
+ _tmp17_ = _g_object_ref0 (_tmp16_);
+ screen = _tmp17_;
+ _tmp18_ = gdk_screen_get_primary_monitor (screen);
+ gdk_screen_get_monitor_geometry (screen, _tmp18_, &_tmp19_);
+ geometry = _tmp19_;
+ gtk_window_set_default_size (self->priv->main_window, geometry.width, geometry.height);
+ gtk_window_move (self->priv->main_window, geometry.x, geometry.y);
_g_object_unref0 (screen);
}
- gtk_container_add ((GtkContainer*) self->priv->main_window, (GtkWidget*) self->user_list);
+ gtk_container_add ((GtkContainer*) self->priv->main_window, (GtkWidget*) self->priv->user_list);
return self;
}
@@ -239,154 +359,124 @@ void unity_greeter_show (UnityGreeter* self) {
}
-static void unity_greeter_connected_cb (UnityGreeter* self) {
- GList* _tmp0_ = NULL;
- gboolean _tmp7_;
- GList* _tmp8_ = NULL;
- g_return_if_fail (self != NULL);
- _tmp0_ = ldm_greeter_get_users (self->priv->greeter);
- {
- GList* user_collection = NULL;
- GList* user_it = NULL;
- user_collection = _tmp0_;
- for (user_it = user_collection; user_it != NULL; user_it = user_it->next) {
- LdmUser* user = NULL;
- user = (LdmUser*) user_it->data;
- {
- const gchar* _tmp1_ = NULL;
- gchar* _tmp2_;
- gchar* label;
- const gchar* _tmp3_ = NULL;
- const gchar* _tmp6_ = NULL;
- _tmp1_ = ldm_user_get_real_name (user);
- _tmp2_ = g_strdup (_tmp1_);
- label = _tmp2_;
- _tmp3_ = ldm_user_get_real_name (user);
- if (_tmp3_ == NULL) {
- const gchar* _tmp4_ = NULL;
- gchar* _tmp5_;
- _tmp4_ = ldm_user_get_name (user);
- _tmp5_ = g_strdup (_tmp4_);
- _g_free0 (label);
- label = _tmp5_;
- }
- _tmp6_ = ldm_user_get_name (user);
- user_list_add_entry (self->user_list, _tmp6_, label, NULL, FALSE);
- _g_free0 (label);
- }
- }
- }
- _tmp7_ = ldm_greeter_get_has_guest_session (self->priv->greeter);
- if (_tmp7_) {
- user_list_add_entry (self->user_list, "*guest", "Guest Account", NULL, FALSE);
- }
- user_list_add_entry (self->user_list, NULL, "Other...", NULL, FALSE);
- _tmp8_ = ldm_greeter_get_sessions (self->priv->greeter);
- {
- GList* session_collection = NULL;
- GList* session_it = NULL;
- session_collection = _tmp8_;
- for (session_it = session_collection; session_it != NULL; session_it = session_it->next) {
- LdmSession* session = NULL;
- session = (LdmSession*) session_it->data;
- {
- const gchar* _tmp9_ = NULL;
- const gchar* _tmp10_ = NULL;
- _tmp9_ = ldm_session_get_key (session);
- _tmp10_ = ldm_session_get_name (session);
- user_list_add_session (self->user_list, _tmp9_, _tmp10_);
- }
- }
- }
-}
-
-
-static void unity_greeter_show_message_cb (UnityGreeter* self, const gchar* text, LdmMessageType type) {
+static void unity_greeter_show_message_cb (UnityGreeter* self, const gchar* text, LightDMMessageType type) {
g_return_if_fail (self != NULL);
g_return_if_fail (text != NULL);
}
-static void unity_greeter_show_prompt_cb (UnityGreeter* self, const gchar* text, LdmPromptType type) {
+static void unity_greeter_show_prompt_cb (UnityGreeter* self, const gchar* text, LightDMPromptType type) {
g_return_if_fail (self != NULL);
g_return_if_fail (text != NULL);
- g_debug ("unity-greeter.vala:97: prompt '%s'", text);
self->priv->prompted = TRUE;
- user_list_show_prompt (self->user_list, text, type == LDM_PROMPT_TYPE_SECRET);
-}
-
-
-static gboolean unity_greeter_test_quit_cb (UnityGreeter* self) {
- gboolean result = FALSE;
- g_return_val_if_fail (self != NULL, FALSE);
- exit (EXIT_SUCCESS);
- result = FALSE;
- return result;
-}
-
-
-static gboolean _unity_greeter_test_quit_cb_gsource_func (gpointer self) {
- gboolean result;
- result = unity_greeter_test_quit_cb (self);
- return result;
+ user_list_show_prompt (self->priv->user_list, text, type == LIGHTDM_PROMPT_TYPE_SECRET);
}
static void unity_greeter_authentication_complete_cb (UnityGreeter* self) {
gboolean is_authenticated = FALSE;
+ GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
if (unity_greeter_test_mode) {
is_authenticated = self->priv->test_is_authenticated;
} else {
gboolean _tmp0_;
- _tmp0_ = ldm_greeter_get_is_authenticated (self->priv->greeter);
+ _tmp0_ = lightdm_greeter_get_is_authenticated (self->priv->greeter);
is_authenticated = _tmp0_;
}
if (is_authenticated) {
if (self->priv->prompted) {
- user_list_login_complete (self->user_list);
+ user_list_login_complete (self->priv->user_list);
if (unity_greeter_test_mode) {
- user_list_login_complete (self->user_list);
- g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1000, _unity_greeter_test_quit_cb_gsource_func, unity_greeter_ref (self), unity_greeter_unref);
+ user_list_login_complete (self->priv->user_list);
} else {
- const gchar* _tmp1_ = NULL;
- _tmp1_ = user_list_get_session (self->user_list);
- ldm_greeter_start_session (self->priv->greeter, _tmp1_);
+ cairo_t* _tmp1_ = NULL;
+ cairo_t* c;
+ cairo_pattern_t* _tmp2_ = NULL;
+ cairo_pattern_t* _tmp3_;
+ GdkScreen* _tmp4_ = NULL;
+ _tmp1_ = cairo_create (unity_greeter_background_surface);
+ c = _tmp1_;
+ _tmp2_ = user_list_get_background (self->priv->user_list);
+ _tmp3_ = _tmp2_;
+ cairo_set_source (c, _tmp3_);
+ _cairo_pattern_destroy0 (_tmp3_);
+ cairo_paint (c);
+ _cairo_destroy0 (c);
+ c = NULL;
+ _tmp4_ = gdk_screen_get_default ();
+ unity_greeter_refresh_background (self, _tmp4_);
+ {
+ const gchar* _tmp5_ = NULL;
+ _tmp5_ = user_list_get_session (self->priv->user_list);
+ lightdm_greeter_start_session_sync (self->priv->greeter, _tmp5_, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ goto __catch1_g_error;
+ }
+ }
+ goto __finally1;
+ __catch1_g_error:
+ {
+ GError* e = NULL;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ g_warning ("unity-greeter.vala:164: Failed to start session: %s", e->message);
+ _g_error_free0 (e);
+ }
+ __finally1:
+ if (_inner_error_ != NULL) {
+ _cairo_destroy0 (c);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ _cairo_destroy0 (c);
}
} else {
self->priv->prompted = TRUE;
- user_list_show_authenticated (self->user_list);
+ user_list_show_authenticated (self->priv->user_list);
}
} else {
- user_list_set_error (self->user_list, "Invalid password, please try again");
- unity_greeter_start_authentication (self);
+ if (self->priv->prompted) {
+ const gchar* _tmp6_ = NULL;
+ _tmp6_ = _ ("Invalid password, please try again");
+ user_list_set_error (self->priv->user_list, _tmp6_);
+ unity_greeter_start_authentication (self);
+ } else {
+ const gchar* _tmp7_ = NULL;
+ _tmp7_ = _ ("Failed to authenticate");
+ user_list_set_error (self->priv->user_list, _tmp7_);
+ user_list_show_authenticated (self->priv->user_list);
+ }
}
}
static void unity_greeter_user_selected_cb (UnityGreeter* self, const gchar* username) {
g_return_if_fail (self != NULL);
- g_debug ("unity-greeter.vala:145: start authentication %s", username);
+ g_debug ("unity-greeter.vala:191: start authentication %s", username);
if (!unity_greeter_test_mode) {
const gchar* _tmp0_ = NULL;
- _tmp0_ = ldm_greeter_get_default_session (self->priv->greeter);
- user_list_set_session (self->user_list, _tmp0_);
+ _tmp0_ = lightdm_greeter_get_default_session_hint (self->priv->greeter);
+ user_list_set_session (self->priv->user_list, _tmp0_);
if (username != NULL) {
- LdmUser* _tmp1_ = NULL;
- LdmUser* _tmp2_;
- LdmUser* user;
- _tmp1_ = ldm_greeter_get_user_by_name (self->priv->greeter, username);
- _tmp2_ = _g_object_ref0 (_tmp1_);
- user = _tmp2_;
+ LightDMUserList* _tmp1_ = NULL;
+ LightDMUser* _tmp2_ = NULL;
+ LightDMUser* _tmp3_;
+ LightDMUser* user;
+ _tmp1_ = lightdm_user_list_get_instance ();
+ _tmp2_ = lightdm_user_list_get_user_by_name (_tmp1_, username);
+ _tmp3_ = _g_object_ref0 (_tmp2_);
+ user = _tmp3_;
if (user != NULL) {
- const gchar* _tmp3_ = NULL;
- _tmp3_ = ldm_user_get_session (user);
- user_list_set_session (self->user_list, _tmp3_);
+ const gchar* _tmp4_ = NULL;
+ _tmp4_ = lightdm_user_get_session (user);
+ user_list_set_session (self->priv->user_list, _tmp4_);
}
_g_object_unref0 (user);
}
}
- user_list_set_error (self->user_list, NULL);
+ user_list_set_error (self->priv->user_list, NULL);
unity_greeter_start_authentication (self);
}
@@ -399,18 +489,18 @@ static void unity_greeter_start_authentication (UnityGreeter* self) {
_g_free0 (self->priv->test_username);
self->priv->test_username = NULL;
self->priv->test_is_authenticated = FALSE;
- _tmp0_ = user_list_get_selected (self->user_list);
+ _tmp0_ = user_list_get_selected (self->priv->user_list);
if (_tmp0_ == NULL) {
- unity_greeter_show_prompt_cb (self, "Username:", LDM_PROMPT_TYPE_QUESTION);
+ unity_greeter_show_prompt_cb (self, "Username:", LIGHTDM_PROMPT_TYPE_QUESTION);
} else {
gboolean _tmp1_ = FALSE;
const gchar* _tmp2_ = NULL;
- _tmp2_ = user_list_get_selected (self->user_list);
+ _tmp2_ = user_list_get_selected (self->priv->user_list);
if (g_strcmp0 (_tmp2_, "*guest") == 0) {
_tmp1_ = TRUE;
} else {
const gchar* _tmp3_ = NULL;
- _tmp3_ = user_list_get_selected (self->user_list);
+ _tmp3_ = user_list_get_selected (self->priv->user_list);
_tmp1_ = g_strcmp0 (_tmp3_, "bob") == 0;
}
if (_tmp1_) {
@@ -419,27 +509,27 @@ static void unity_greeter_start_authentication (UnityGreeter* self) {
} else {
const gchar* _tmp4_ = NULL;
gchar* _tmp5_;
- _tmp4_ = user_list_get_selected (self->user_list);
+ _tmp4_ = user_list_get_selected (self->priv->user_list);
_tmp5_ = g_strdup (_tmp4_);
_g_free0 (self->priv->test_username);
self->priv->test_username = _tmp5_;
- unity_greeter_show_prompt_cb (self, "Password:", LDM_PROMPT_TYPE_SECRET);
+ unity_greeter_show_prompt_cb (self, "Password:", LIGHTDM_PROMPT_TYPE_SECRET);
}
}
} else {
const gchar* _tmp6_ = NULL;
- _tmp6_ = user_list_get_selected (self->user_list);
+ _tmp6_ = user_list_get_selected (self->priv->user_list);
if (_tmp6_ == NULL) {
- ldm_greeter_login_with_user_prompt (self->priv->greeter);
+ lightdm_greeter_authenticate (self->priv->greeter, NULL);
} else {
const gchar* _tmp7_ = NULL;
- _tmp7_ = user_list_get_selected (self->user_list);
+ _tmp7_ = user_list_get_selected (self->priv->user_list);
if (g_strcmp0 (_tmp7_, "*guest") == 0) {
- ldm_greeter_login_as_guest (self->priv->greeter);
+ lightdm_greeter_authenticate_as_guest (self->priv->greeter);
} else {
const gchar* _tmp8_ = NULL;
- _tmp8_ = user_list_get_selected (self->user_list);
- ldm_greeter_login (self->priv->greeter, _tmp8_);
+ _tmp8_ = user_list_get_selected (self->priv->user_list);
+ lightdm_greeter_authenticate (self->priv->greeter, _tmp8_);
}
}
}
@@ -449,35 +539,182 @@ static void unity_greeter_start_authentication (UnityGreeter* self) {
static void unity_greeter_respond_to_prompt_cb (UnityGreeter* self, const gchar* text) {
g_return_if_fail (self != NULL);
g_return_if_fail (text != NULL);
- user_list_set_error (self->user_list, NULL);
+ user_list_set_error (self->priv->user_list, NULL);
if (unity_greeter_test_mode) {
- g_debug ("unity-greeter.vala:200: response %s", text);
+ g_debug ("unity-greeter.vala:246: response %s", text);
if (self->priv->test_username == NULL) {
gchar* _tmp0_;
- g_debug ("unity-greeter.vala:203: username=%s", text);
+ g_debug ("unity-greeter.vala:249: username=%s", text);
_tmp0_ = g_strdup (text);
_g_free0 (self->priv->test_username);
self->priv->test_username = _tmp0_;
- unity_greeter_show_prompt_cb (self, "Password:", LDM_PROMPT_TYPE_SECRET);
+ unity_greeter_show_prompt_cb (self, "Password:", LIGHTDM_PROMPT_TYPE_SECRET);
} else {
self->priv->test_is_authenticated = g_strcmp0 (text, "password") == 0;
unity_greeter_authentication_complete_cb (self);
}
} else {
- ldm_greeter_respond (self->priv->greeter, text);
+ lightdm_greeter_respond (self->priv->greeter, text);
}
}
static void unity_greeter_start_session_cb (UnityGreeter* self) {
+ gboolean is_authenticated;
g_return_if_fail (self != NULL);
- unity_greeter_authentication_complete_cb (self);
+ is_authenticated = FALSE;
+ if (unity_greeter_test_mode) {
+ is_authenticated = self->priv->test_is_authenticated;
+ } else {
+ gboolean _tmp0_;
+ _tmp0_ = lightdm_greeter_get_is_authenticated (self->priv->greeter);
+ is_authenticated = _tmp0_;
+ }
+ if (is_authenticated) {
+ unity_greeter_authentication_complete_cb (self);
+ } else {
+ unity_greeter_start_authentication (self);
+ }
+}
+
+
+gchar* unity_greeter_get_config_value (const gchar* group_name, const gchar* key, const gchar* _default_) {
+ gchar* result = NULL;
+ GError * _inner_error_ = NULL;
+ g_return_val_if_fail (group_name != NULL, NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+ {
+ gchar* _tmp0_ = NULL;
+ gchar* _tmp1_;
+ _tmp0_ = g_key_file_get_value (unity_greeter_config, group_name, key, &_inner_error_);
+ _tmp1_ = _tmp0_;
+ if (_inner_error_ != NULL) {
+ goto __catch2_g_error;
+ }
+ result = _tmp1_;
+ return result;
+ }
+ goto __finally2;
+ __catch2_g_error:
+ {
+ GError* e = NULL;
+ gboolean _tmp2_ = FALSE;
+ gchar* _tmp3_;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ if (g_error_matches (e, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
+ _tmp2_ = TRUE;
+ } else {
+ _tmp2_ = g_error_matches (e, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND);
+ }
+ if (!_tmp2_) {
+ g_warning ("unity-greeter.vala:287: Error reading configuration item %s:%s: %s", group_name, key, e->message);
+ }
+ _tmp3_ = g_strdup (_default_);
+ result = _tmp3_;
+ _g_error_free0 (e);
+ return result;
+ }
+ __finally2:
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return NULL;
}
-static void unity_greeter_quit_cb (UnityGreeter* self) {
+static cairo_surface_t* unity_greeter_create_root_surface (GdkScreen* screen) {
+ cairo_surface_t* result = NULL;
+ GdkVisual* _tmp0_ = NULL;
+ GdkVisual* _tmp1_;
+ GdkVisual* visual;
+ GdkDisplay* _tmp2_ = NULL;
+ const gchar* _tmp3_ = NULL;
+ Display* _tmp4_ = NULL;
+ Display* display;
+ GdkWindow* _tmp5_ = NULL;
+ Window _tmp6_;
+ gint _tmp7_;
+ gint _tmp8_;
+ gint _tmp9_;
+ gint _tmp10_;
+ gint pixmap;
+ GdkDisplay* _tmp11_ = NULL;
+ Display* _tmp12_ = NULL;
+ Display* xdisplay;
+ GdkVisual* _tmp13_ = NULL;
+ gint _tmp14_;
+ gint _tmp15_;
+ cairo_surface_t* _tmp16_ = NULL;
+ cairo_surface_t* surface;
+ GdkWindow* _tmp17_ = NULL;
+ Window _tmp18_;
+ gint _tmp19_;
+ g_return_val_if_fail (screen != NULL, NULL);
+ _tmp0_ = gdk_screen_get_system_visual (screen);
+ _tmp1_ = _g_object_ref0 (_tmp0_);
+ visual = _tmp1_;
+ gdk_flush ();
+ _tmp2_ = gdk_screen_get_display (screen);
+ _tmp3_ = gdk_display_get_name (_tmp2_);
+ _tmp4_ = XOpenDisplay (_tmp3_);
+ display = _tmp4_;
+ if (display == NULL) {
+ g_warning ("unity-greeter.vala:301: Failed to create root pixmap");
+ result = NULL;
+ _XCloseDisplay0 (display);
+ _g_object_unref0 (visual);
+ return result;
+ }
+ XSetCloseDownMode (display, RetainPermanent);
+ _tmp5_ = gdk_screen_get_root_window (screen);
+ _tmp6_ = gdk_x11_window_get_xid (_tmp5_);
+ _tmp7_ = gdk_screen_width ();
+ _tmp8_ = gdk_screen_height ();
+ _tmp9_ = gdk_visual_get_depth (visual);
+ _tmp10_ = XCreatePixmap (display, (Drawable) _tmp6_, (guint) _tmp7_, (guint) _tmp8_, (guint) _tmp9_);
+ pixmap = _tmp10_;
+ _tmp11_ = gdk_screen_get_display (screen);
+ _tmp12_ = gdk_x11_display_get_xdisplay (_tmp11_);
+ xdisplay = _tmp12_;
+ _tmp13_ = gdk_x11_visual_get_xvisual (visual);
+ _tmp14_ = gdk_screen_width ();
+ _tmp15_ = gdk_screen_height ();
+ _tmp16_ = cairo_xlib_surface_create (xdisplay, pixmap, _tmp13_, _tmp14_, _tmp15_);
+ surface = _tmp16_;
+ _tmp17_ = gdk_screen_get_root_window (screen);
+ _tmp18_ = gdk_x11_window_get_xid (_tmp17_);
+ _tmp19_ = cairo_xlib_surface_get_drawable (surface);
+ XSetWindowBackgroundPixmap (xdisplay, _tmp18_, _tmp19_);
+ result = surface;
+ _XCloseDisplay0 (display);
+ _g_object_unref0 (visual);
+ return result;
+}
+
+
+static void unity_greeter_refresh_background (UnityGreeter* self, GdkScreen* screen) {
+ GdkDisplay* _tmp0_ = NULL;
+ Display* _tmp1_ = NULL;
+ GdkWindow* _tmp2_ = NULL;
+ Window _tmp3_;
g_return_if_fail (self != NULL);
- exit (EXIT_SUCCESS);
+ g_return_if_fail (screen != NULL);
+ gdk_flush ();
+ _tmp0_ = gdk_screen_get_display (screen);
+ _tmp1_ = gdk_x11_display_get_xdisplay (_tmp0_);
+ _tmp2_ = gdk_screen_get_root_window (screen);
+ _tmp3_ = gdk_x11_window_get_xid (_tmp2_);
+ XClearWindow (_tmp1_, _tmp3_);
+}
+
+
+static gdouble double_parse (const gchar* str) {
+ gdouble result = 0.0;
+ gdouble _tmp0_;
+ g_return_val_if_fail (str != NULL, 0.0);
+ _tmp0_ = g_ascii_strtod (str, NULL);
+ result = _tmp0_;
+ return result;
}
@@ -486,11 +723,24 @@ gint unity_greeter_main (gchar** args, int args_length1) {
GdkWindow* _tmp0_ = NULL;
GdkCursor* _tmp1_ = NULL;
GdkCursor* _tmp2_;
- const gchar* _tmp3_ = NULL;
- GOptionContext* _tmp4_ = NULL;
+ GdkScreen* _tmp3_ = NULL;
+ cairo_surface_t* _tmp4_ = NULL;
+ const gchar* _tmp5_ = NULL;
+ GOptionContext* _tmp6_ = NULL;
GOptionContext* c;
- GOptionGroup* _tmp5_ = NULL;
- UnityGreeter* _tmp7_ = NULL;
+ GOptionGroup* _tmp7_ = NULL;
+ GKeyFile* _tmp9_ = NULL;
+ GtkSettings* _tmp10_ = NULL;
+ GtkSettings* _tmp11_;
+ GtkSettings* settings;
+ gchar* _tmp12_ = NULL;
+ gchar* value;
+ gchar* _tmp13_ = NULL;
+ gchar* _tmp14_ = NULL;
+ gchar* _tmp16_ = NULL;
+ gchar* _tmp18_ = NULL;
+ gchar* _tmp19_ = NULL;
+ UnityGreeter* _tmp20_ = NULL;
UnityGreeter* greeter;
GError * _inner_error_ = NULL;
gtk_init (&args_length1, &args);
@@ -499,35 +749,39 @@ gint unity_greeter_main (gchar** args, int args_length1) {
_tmp2_ = _tmp1_;
gdk_window_set_cursor (_tmp0_, _tmp2_);
_g_object_unref0 (_tmp2_);
- _tmp3_ = _ ("- Unity Greeter");
- _tmp4_ = g_option_context_new (_tmp3_);
- c = _tmp4_;
+ _tmp3_ = gdk_screen_get_default ();
+ _tmp4_ = unity_greeter_create_root_surface (_tmp3_);
+ _cairo_surface_destroy0 (unity_greeter_background_surface);
+ unity_greeter_background_surface = _tmp4_;
+ _tmp5_ = _ ("- Unity Greeter");
+ _tmp6_ = g_option_context_new (_tmp5_);
+ c = _tmp6_;
g_option_context_add_main_entries (c, UNITY_GREETER_options, GETTEXT_PACKAGE);
- _tmp5_ = gtk_get_option_group (TRUE);
- g_option_context_add_group (c, _tmp5_);
+ _tmp7_ = gtk_get_option_group (TRUE);
+ g_option_context_add_group (c, _tmp7_);
{
g_option_context_parse (c, &args_length1, &args, &_inner_error_);
if (_inner_error_ != NULL) {
- goto __catch0_g_error;
+ goto __catch3_g_error;
}
}
- goto __finally0;
- __catch0_g_error:
+ goto __finally3;
+ __catch3_g_error:
{
GError* e = NULL;
- const gchar* _tmp6_ = NULL;
+ const gchar* _tmp8_ = NULL;
e = _inner_error_;
_inner_error_ = NULL;
fprintf (stderr, "%s\n", e->message);
- _tmp6_ = _ ("Run '%s --help' to see a full list of available command line options.");
- fprintf (stderr, _tmp6_, args[0]);
+ _tmp8_ = _ ("Run '%s --help' to see a full list of available command line options.");
+ fprintf (stderr, _tmp8_, args[0]);
fprintf (stderr, "\n");
result = EXIT_FAILURE;
_g_error_free0 (e);
_g_option_context_free0 (c);
return result;
}
- __finally0:
+ __finally3:
if (_inner_error_ != NULL) {
_g_option_context_free0 (c);
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -540,12 +794,83 @@ gint unity_greeter_main (gchar** args, int args_length1) {
_g_option_context_free0 (c);
return result;
}
- _tmp7_ = unity_greeter_new ();
- greeter = _tmp7_;
+ _tmp9_ = g_key_file_new ();
+ _g_key_file_free0 (unity_greeter_config);
+ unity_greeter_config = _tmp9_;
+ {
+ g_key_file_load_from_file (unity_greeter_config, CONFIG_FILE, G_KEY_FILE_NONE, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ goto __catch4_g_error;
+ }
+ }
+ goto __finally4;
+ __catch4_g_error:
+ {
+ GError* e = NULL;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ if (!g_error_matches (e, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+ g_warning ("unity-greeter.vala:375: Failed to load configuration from %s: %s\n", CONFIG_FILE, e->message);
+ }
+ _g_error_free0 (e);
+ }
+ __finally4:
+ if (_inner_error_ != NULL) {
+ _g_option_context_free0 (c);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return 0;
+ }
+ _tmp10_ = gtk_settings_get_default ();
+ _tmp11_ = _g_object_ref0 (_tmp10_);
+ settings = _tmp11_;
+ _tmp12_ = unity_greeter_get_config_value ("greeter", "theme-name", NULL);
+ value = _tmp12_;
+ if (value != NULL) {
+ g_object_set ((GObject*) settings, "gtk-theme-name", value, NULL, NULL);
+ }
+ _tmp13_ = unity_greeter_get_config_value ("greeter", "font-name", NULL);
+ _g_free0 (value);
+ value = _tmp13_;
+ if (value != NULL) {
+ g_object_set ((GObject*) settings, "gtk-font-name", value, NULL, NULL);
+ }
+ _tmp14_ = unity_greeter_get_config_value ("greeter", "xft-dpi", NULL);
+ _g_free0 (value);
+ value = _tmp14_;
+ if (value != NULL) {
+ gdouble _tmp15_;
+ _tmp15_ = double_parse (value);
+ g_object_set ((GObject*) settings, "gtk-xft-dpi", (gint) (1024 * _tmp15_), NULL, NULL);
+ }
+ _tmp16_ = unity_greeter_get_config_value ("greeter", "xft-antialias", NULL);
+ _g_free0 (value);
+ value = _tmp16_;
+ if (value != NULL) {
+ gint _tmp17_;
+ _tmp17_ = g_strcmp0 (value, "true");
+ g_object_set ((GObject*) settings, "gtk-xft-antialias", _tmp17_ == 0, NULL, NULL);
+ }
+ _tmp18_ = unity_greeter_get_config_value ("greeter", "xft-hintstyle", NULL);
+ _g_free0 (value);
+ value = _tmp18_;
+ if (value != NULL) {
+ g_object_set ((GObject*) settings, "gtk-xft-hintstyle", value, NULL, NULL);
+ }
+ _tmp19_ = unity_greeter_get_config_value ("greeter", "xft-rgba", NULL);
+ _g_free0 (value);
+ value = _tmp19_;
+ if (value != NULL) {
+ g_object_set ((GObject*) settings, "gtk-xft-rgba", value, NULL, NULL);
+ }
+ _tmp20_ = unity_greeter_new ();
+ greeter = _tmp20_;
unity_greeter_show (greeter);
gtk_main ();
result = EXIT_SUCCESS;
_unity_greeter_unref0 (greeter);
+ _g_free0 (value);
+ _g_object_unref0 (settings);
_g_option_context_free0 (c);
return result;
}
@@ -686,7 +1011,7 @@ static void unity_greeter_instance_init (UnityGreeter * self) {
static void unity_greeter_finalize (UnityGreeter* obj) {
UnityGreeter * self;
self = UNITY_GREETER (obj);
- _g_object_unref0 (self->user_list);
+ _g_object_unref0 (self->priv->user_list);
_g_object_unref0 (self->priv->main_window);
_g_object_unref0 (self->priv->greeter);
_g_free0 (self->priv->test_username);
diff --git a/src/unity-greeter.vala b/src/unity-greeter.vala
index 9c4e71b3..9123c00a 100644
--- a/src/unity-greeter.vala
+++ b/