lightdm: update to 1.8.1.

This commit is contained in:
Juan RP 2013-10-11 09:49:48 +02:00
parent 26ce556304
commit 73029baabb
6 changed files with 19 additions and 257 deletions

View file

@ -1,11 +1,11 @@
[Unit]
Description=Light Display Manager
Documentation=man:lightdm(1)
Conflicts=getty@tty1.service
After=systemd-user-sessions.service getty@tty1.service
After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service
[Service]
ExecStart=/usr/sbin/lightdm --log-dir=/var/log/lightdm --run-dir=/run/lightdm \
--cache-dir=/var/cache/lightdm
ExecStart=/usr/sbin/lightdm --log-dir=/var/log/lightdm --run-dir=/run/lightdm --cache-dir=/var/cache/lightdm
Restart=always
IgnoreSIGPIPE=no
BusName=org.freedesktop.DisplayManager

View file

@ -0,0 +1,2 @@
d /run/lightdm 0711 lightdm lightdm

View file

@ -1,16 +0,0 @@
--- liblightdm-gobject/Makefile.in.orig 2013-04-15 23:50:58.760043808 +0200
+++ liblightdm-gobject/Makefile.in 2013-04-15 23:51:10.967119526 +0200
@@ -372,11 +372,11 @@ liblightdm_gobject_1_la_SOURCES = \
user.c \
$(liblightdm_gobject_1include_HEADERS)
-@HAVE_INTROSPECTION_TRUE@INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all
+@HAVE_INTROSPECTION_TRUE@INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all --symbol-prefix=lightdm
@HAVE_INTROSPECTION_TRUE@INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
@HAVE_INTROSPECTION_TRUE@INTROSPECTION_GIRS = LightDM-1.gir
@HAVE_INTROSPECTION_TRUE@LightDM_1_gir_INCLUDES = GObject-2.0
-@HAVE_INTROSPECTION_TRUE@LightDM_1_gir_CFLAGS = $(INCLUDES) --symbol-prefix=lightdm
+@HAVE_INTROSPECTION_TRUE@LightDM_1_gir_CFLAGS = $(INCLUDES)
@HAVE_INTROSPECTION_TRUE@LightDM_1_gir_LIBS = liblightdm-gobject-1.la
@HAVE_INTROSPECTION_TRUE@LightDM_1_gir_FILES = $(liblightdm_gobject_1_la_SOURCES)
@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0

View file

@ -1,191 +0,0 @@
--- liblightdm-gobject/power.c.systemd_login1 2011-12-08 19:51:23.000000000 -0600
+++ liblightdm-gobject/power.c 2012-11-05 12:33:21.402801485 -0600
@@ -18,6 +18,7 @@
static GDBusProxy *upower_proxy = NULL;
static GDBusProxy *ck_proxy = NULL;
+static GDBusProxy *login1_proxy = NULL;
static gboolean
upower_call_function (const gchar *function, gboolean default_result, GError **error)
@@ -148,6 +149,59 @@ ck_call_function (const gchar *function,
return function_result;
}
+static gboolean
+login1_call_function (const gchar *function, GVariant *parameters, gboolean default_result, GError **error)
+{
+ GVariant *result;
+ gboolean function_result = FALSE;
+ const gchar *true_result = "yes";
+ gchar *str_result;
+
+ if (!login1_proxy)
+ {
+ login1_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.freedesktop.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager",
+ NULL,
+ error);
+ if (!login1_proxy)
+ return FALSE;
+ }
+
+ result = g_dbus_proxy_call_sync (login1_proxy,
+ function,
+ parameters,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ error);
+
+ if (!result)
+ return default_result;
+
+ if (g_variant_is_of_type (result, G_VARIANT_TYPE ("(b)")))
+ g_variant_get (result, "(s)", &function_result);
+
+ /**
+ * CanReboot, CanPowerOff returns a string "yes", "no", or "challenge", not a boolean as ConsoleKit
+ **/
+ if (g_variant_is_of_type (result, G_VARIANT_TYPE ("(s)"))) {
+ g_variant_get (result, "(b)", str_result);
+ if(g_strcmp0(str_result,true_result) == 0) {
+ function_result = TRUE;
+ }
+ else {
+ function_result = default_result;
+ }
+ }
+
+ g_variant_unref (result);
+ return function_result;
+}
+
/**
* lightdm_get_can_restart:
*
@@ -158,7 +212,11 @@ ck_call_function (const gchar *function,
gboolean
lightdm_get_can_restart (void)
{
- return ck_call_function ("CanRestart", FALSE, NULL);
+ gboolean function_result = FALSE;
+ function_result = login1_call_function ("CanReboot", NULL, FALSE, NULL);
+ if (!function_result)
+ function_result = ck_call_function ("CanRestart", FALSE, NULL);
+ return function_result;
}
/**
@@ -172,7 +230,11 @@ lightdm_get_can_restart (void)
gboolean
lightdm_restart (GError **error)
{
- return ck_call_function ("Restart", TRUE, error);
+ gboolean function_result = FALSE;
+ function_result = login1_call_function ("Reboot", g_variant_new("(b)",0), TRUE, error);
+ if (!function_result)
+ function_result = ck_call_function ("Restart", TRUE, error);
+ return function_result;
}
/**
@@ -185,7 +247,11 @@ lightdm_restart (GError **error)
gboolean
lightdm_get_can_shutdown (void)
{
- return ck_call_function ("CanStop", FALSE, NULL);
+ gboolean function_result = FALSE;
+ function_result = login1_call_function ("CanPowerOff", NULL, FALSE, NULL);
+ if (!function_result)
+ function_result = ck_call_function ("CanStop", FALSE, NULL);
+ return function_result;
}
/**
@@ -199,5 +265,9 @@ lightdm_get_can_shutdown (void)
gboolean
lightdm_shutdown (GError **error)
{
- return ck_call_function ("Stop", TRUE, error);
+ gboolean function_result = FALSE;
+ function_result = login1_call_function ("PowerOff", g_variant_new("(b)",0), TRUE, error);
+ if (!function_result)
+ function_result = ck_call_function ("Stop", TRUE, error);
+ return function_result;
}
--- liblightdm-qt/power.cpp.systemd_login1 2011-12-08 19:51:23.000000000 -0600
+++ liblightdm-qt/power.cpp 2012-11-05 12:36:47.261292317 -0600
@@ -27,11 +27,13 @@ public:
PowerInterfacePrivate();
QScopedPointer<QDBusInterface> powerManagementInterface;
QScopedPointer<QDBusInterface> consoleKitInterface;
+ QScopedPointer<QDBusInterface> login1Interface;
};
PowerInterface::PowerInterfacePrivate::PowerInterfacePrivate() :
powerManagementInterface(new QDBusInterface("org.freedesktop.UPower","/org/freedesktop/UPower", "org.freedesktop.UPower", QDBusConnection::systemBus())),
- consoleKitInterface(new QDBusInterface("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager", QDBusConnection::systemBus()))
+ consoleKitInterface(new QDBusInterface("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager", QDBusConnection::systemBus())),
+ login1Interface(new QDBusInterface("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", QDBusConnection::systemBus()))
{
}
@@ -81,34 +83,45 @@ void PowerInterface::hibernate()
bool PowerInterface::canShutdown()
{
+ QDBusReply<QString> reply1 = d->login1Interface->call("CanPowerOff");
+ if ( reply1.isValid()) {
+ return (reply1.value()=="yes");
+ }
QDBusReply<bool> reply = d->consoleKitInterface->call("CanStop");
if (reply.isValid()) {
return reply.value();
}
- else {
- return false;
- }
+ return false;
}
void PowerInterface::shutdown()
{
- d->consoleKitInterface->call("Stop");
+ QDBusReply<bool> reply = d->login1Interface->call("PowerOff",0);
+ if (!reply.isValid())
+ d->consoleKitInterface->call("Stop");
}
bool PowerInterface::canRestart()
{
+
+ QDBusReply<QString> reply1 = d->login1Interface->call("CanReboot");
+ if (reply1.isValid()) {
+ return (reply1.value()=="yes");
+ }
+
QDBusReply<bool> reply = d->consoleKitInterface->call("CanRestart");
if (reply.isValid()) {
return reply.value();
}
- else {
- return false;
- }
+
+ return false;
}
void PowerInterface::restart()
{
- d->consoleKitInterface->call("Restart");
+ QDBusReply<bool> reply = d->login1Interface->call("Reboot",0);
+ if (!reply.isValid())
+ d->consoleKitInterface->call("Restart");
}
#include "power_moc.cpp"

View file

@ -1,32 +0,0 @@
--- data/lightdm.conf.orig 2012-10-05 09:43:48.307845764 +0200
+++ data/lightdm.conf 2012-10-05 09:44:57.956957476 +0200
@@ -19,9 +19,9 @@
#start-default-seat=true
#greeter-user=lightdm
#minimum-display-number=0
-#minimum-vt=7
+minimum-vt=1
#lock-memory=true
-#user-authority-in-system-dir=false
+user-authority-in-system-dir=true
#guest-account-script=guest-account
#log-directory=/var/log/lightdm
#run-directory=/var/run/lightdm
@@ -69,7 +69,7 @@
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
-#greeter-session=example-gtk-gnome
+greeter-session=lightdm-gtk-greeter
#greeter-hide-users=false
#greeter-allow-guest=true
#greeter-show-manual-login=false
@@ -77,7 +77,7 @@
#user-session=default
#allow-guest=true
#guest-session=UNIMPLEMENTED
-#session-wrapper=lightdm-session
+#session-wrapper=lightdm-session
#display-setup-script=
#greeter-setup-script=
#session-setup-script=

View file

@ -1,6 +1,6 @@
# Template file for 'lightdm'
pkgname=lightdm
version=1.4.1
version=1.8.1
revision=1
build_style=gnu-configure
configure_args="--with-greeter-session=lightdm-gtk-greeter
@ -9,8 +9,8 @@ short_desc="Light Display Manager"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-3, LGPL-3"
homepage="https://launchpad.net/lightdm"
distfiles="https://launchpad.net/lightdm/1.4/$version/+download/$pkgname-$version.tar.gz"
checksum=f9ca1c03c3330b6265d03048f1ebafda596c436f279b5382bda656ab3a619439
distfiles="https://launchpad.net/lightdm/${version%.*}/$version/+download/$pkgname-$version.tar.xz"
checksum=e749ea72ac2517f592a8dfcd8bbdf7aba6729cb75c569c03347751d87f99305a
long_desc="
An X display manager that:
* Has a lightweight codebase
@ -19,14 +19,16 @@ long_desc="
* Fully themeable (easiest with the webkit interface)
* Cross-desktop (greeters can be written in any toolkit)"
makedepends="pkg-config intltool dbus-glib-devel libxklavier-devel libxml2-devel
hostmakedepends="pkg-config intltool itstool gobject-introspection which"
makedepends="dbus-glib-devel libxklavier-devel libxml2-devel
qt-devel gtk+3-devel libxcb-devel libXdmcp-devel pam-devel vala-devel
gobject-introspection itstool gnome-icon-theme dbus"
libgcrypt-devel gnome-icon-theme dbus"
post_install() {
# Remove provided init file and use our own.
rm -rf ${DESTDIR}/etc/init
vinstall ${FILESDIR}/lightdm.service 644 usr/lib/systemd/system
vinstall ${FILESDIR}/lightdm.tmpfiles 644 usr/lib/tmpfiles.d lightdm.conf
vinstall ${FILESDIR}/lightdm.pam 644 etc/pam.d lightdm
vinstall ${FILESDIR}/lightdm-autologin.pam 644 etc/pam.d lightdm-autologin
vinstall ${FILESDIR}/xsession 755 etc/lightdm
@ -36,9 +38,6 @@ post_install() {
# Minimum UID shall be 1000 for ordinary users.
sed -i -e "s|^\(minimum-uid=\).*|\11000|" \
${DESTDIR}/etc/lightdm/users.conf
# Fix path to nologin.
sed -i -e "s|/usr/sbin/nologin|/sbin/nologin|g" \
${DESTDIR}/etc/lightdm/users.conf
# Provide a working session wrapper.
sed -i -e "s|#session-wrapper=lightdm-session|session-wrapper=/etc/lightdm/xsession|g" \
${DESTDIR}/etc/lightdm/lightdm.conf
@ -48,30 +47,31 @@ post_install() {
}
liblightdm-gobject_package() {
short_desc="${short_desc} - GObject support library"
short_desc+=" - GObject support library"
pkg_install() {
vmove "usr/lib/liblightdm-gobject*.so*"
vmove "usr/lib/liblightdm-gobject*.so.*"
vmove usr/lib/girepository-1.0
}
}
liblightdm-qt_package() {
short_desc="${short_desc} - QT support library"
short_desc+=" - QT support library"
pkg_install() {
vmove "usr/lib/liblightdm-qt*.so*"
vmove "usr/lib/liblightdm-qt*.so.*"
}
}
lightdm-devel_package() {
depends="libglib-devel liblightdm-gobject-${version}_${revision}
liblightdm-qt-${version}_${revision}"
short_desc="${short_desc} - development files"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove usr/share/gtk-doc
vmove usr/share/vala
vmove usr/share/gir-1.0
vmove "usr/lib/*.so"
}
}
@ -88,7 +88,6 @@ lightdm_package() {
make_dirs="/var/cache/lightdm 0755 lightdm lightdm"
depends="gnome-icon-theme dbus accountsservice upower"
pkg_install() {
vmove etc
vmove usr
vmove all
}
}