Commit dae89542 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Fix up the handling of dependencies. Make the daemon only depend on x11,

2007-10-04  William Jon McCann  <mccann@jhu.edu>

	* acinclude.m4:
	* common/Makefile.am:
	* configure.ac:
	* daemon/Makefile.am:
	* daemon/gdm-factory-slave.c: (run_greeter),
	(idle_connect_to_display):
	* daemon/gdm-product-slave.c: (setup_server),
	(idle_connect_to_display):
	* daemon/gdm-simple-slave.c: (run_greeter),
	(idle_connect_to_display):
	* daemon/gdm-slave.c: (gdm_slave_set_busy_cursor),
	(set_local_auth), (gdm_slave_connect_to_x11_display):
	* daemon/gdm-slave.h:
	* gui/Makefile.am:
	* gui/modules/.cvsignore:
	* gui/modules/AccessDwellMouseEvents.in:
	* gui/modules/AccessKeyMouseEvents.in:
	* gui/modules/Makefile.am:
	* gui/modules/dwellmouselistener.c:
	* gui/modules/keymouselistener.c:
	* gui/simple-chooser/Makefile.am:
	* gui/simple-greeter/Makefile.am:
	* gui/simple-greeter/libnotificationarea/Makefile.am:
	* libgreeter/Makefile.am:
	Fix up the handling of dependencies.  Make the daemon
	only depend on x11, glib, gobject, dbus.  Move some
	things from the slaves to the base class.
	Remove the unused modules for now.


svn path=/branches/mccann-gobject/; revision=5338
parent f0de3c35
2007-10-04 William Jon McCann <mccann@jhu.edu>
* acinclude.m4:
* common/Makefile.am:
* configure.ac:
* daemon/Makefile.am:
* daemon/gdm-factory-slave.c: (run_greeter),
(idle_connect_to_display):
* daemon/gdm-product-slave.c: (setup_server),
(idle_connect_to_display):
* daemon/gdm-simple-slave.c: (run_greeter),
(idle_connect_to_display):
* daemon/gdm-slave.c: (gdm_slave_set_busy_cursor),
(set_local_auth), (gdm_slave_connect_to_x11_display):
* daemon/gdm-slave.h:
* gui/Makefile.am:
* gui/modules/.cvsignore:
* gui/modules/AccessDwellMouseEvents.in:
* gui/modules/AccessKeyMouseEvents.in:
* gui/modules/Makefile.am:
* gui/modules/dwellmouselistener.c:
* gui/modules/keymouselistener.c:
* gui/simple-chooser/Makefile.am:
* gui/simple-greeter/Makefile.am:
* gui/simple-greeter/libnotificationarea/Makefile.am:
* libgreeter/Makefile.am:
Fix up the handling of dependencies. Make the daemon
only depend on x11, glib, gobject, dbus. Move some
things from the slaves to the base class.
Remove the unused modules for now.
2007-10-03 William Jon McCann <mccann@jhu.edu>
* gui/simple-greeter/greeter-main.c: (main):
......
......@@ -286,3 +286,90 @@ fi
AC_MSG_RESULT($result)
])
dnl EXTRA_COMPILE_WARNINGS
dnl Turn on many useful compiler warnings
dnl For now, only works on GCC
AC_DEFUN([EXTRA_COMPILE_WARNINGS],[
dnl ******************************
dnl More compiler warnings
dnl ******************************
AC_ARG_ENABLE(compile-warnings,
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
[Turn on compiler warnings]),,
[enable_compile_warnings="m4_default([$1],[yes])"])
warnCFLAGS=
if test "x$GCC" != xyes; then
enable_compile_warnings=no
fi
warning_flags=
realsave_CFLAGS="$CFLAGS"
case "$enable_compile_warnings" in
no)
warning_flags=
;;
minimum)
warning_flags="-Wall"
;;
yes)
warning_flags="-Wall -Wmissing-prototypes"
;;
maximum|error)
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
CFLAGS="$warning_flags $CFLAGS"
for option in -Wno-sign-compare; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
CFLAGS="$SAVE_CFLAGS"
AC_MSG_RESULT($has_option)
if test $has_option = yes; then
warning_flags="$warning_flags $option"
fi
unset has_option
unset SAVE_CFLAGS
done
unset option
if test "$enable_compile_warnings" = "error" ; then
warning_flags="$warning_flags -Werror"
fi
;;
*)
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
;;
esac
CFLAGS="$realsave_CFLAGS"
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
AC_MSG_RESULT($warning_flags)
AC_ARG_ENABLE(iso-c,
AC_HELP_STRING([--enable-iso-c],
[Try to warn if code is not ISO C ]),,
[enable_iso_c=no])
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
complCFLAGS=
if test "x$enable_iso_c" != "xno"; then
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-ansi[\ \ ]*) ;;
*) complCFLAGS="$complCFLAGS -ansi" ;;
esac
case " $CFLAGS " in
*[\ \ ]-pedantic[\ \ ]*) ;;
*) complCFLAGS="$complCFLAGS -pedantic" ;;
esac
fi
fi
AC_MSG_RESULT($complCFLAGS)
WARN_CFLAGS="$warning_flags $complCFLAGS"
AC_SUBST(WARN_CFLAGS)
])
......@@ -3,9 +3,9 @@
NULL =
INCLUDES = \
-I. \
-I.. \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I. \
-I.. \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DAUTHDIR=\"$(authdir)\" \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
......@@ -21,8 +21,8 @@ INCLUDES = \
-DGDM_DEFAULTS_CONF=\"$(GDM_DEFAULTS_CONF)\" \
-DGDM_CUSTOM_CONF=\"$(GDM_CUSTOM_CONF)\" \
-DGDM_OLD_CONF=\"$(GDM_OLD_CONF)\" \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS)
$(COMMON_CFLAGS) \
$(NULL)
noinst_LTLIBRARIES = \
libgdmcommon.la \
......@@ -79,7 +79,7 @@ libgdmcommon_la_CPPFLAGS = \
$(NULL)
libgdmcommon_la_CFLAGS = \
$(DBUS_CFLAGS) \
$(COMMON_CFLAGS) \
$(NULL)
libgdmcommon_la_LIBADD = \
......@@ -101,7 +101,7 @@ test_log_SOURCES = \
test_log_LDADD = \
libgdmcommon.la \
$(GLIB_LIBS) \
$(COMMON_LIBS) \
$(NULL)
test_settings_server_SOURCES = \
......@@ -110,8 +110,7 @@ test_settings_server_SOURCES = \
test_settings_server_LDADD = \
libgdmcommon.la \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
$(COMMON_LIBS) \
$(NULL)
test_settings_client_SOURCES = \
......@@ -120,8 +119,7 @@ test_settings_client_SOURCES = \
test_settings_client_LDADD = \
libgdmcommon.la \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
$(COMMON_LIBS) \
$(NULL)
CLEANFILES = \
......
......@@ -24,13 +24,14 @@ IT_PROG_INTLTOOL([0.35.0])
GNOME_DOC_INIT
DBUS_GLIB_REQUIRED=0.74
GLIB_REQUIRED=2.13.0
GTK_REQUIRED=2.10.0
GNOME_VFS_REQUIRED=2.18.0
PANGO_REQUIRED=1.3.0
LIBGLADE_REQUIRED=1.99.2
SCROLLKEEPER_REQUIRED=0.1.4
X11_REQUIRED_VERSION=1.0.0
DBUS_GLIB_REQUIRED_VERSION=0.74
GLIB_REQUIRED_VERSION=2.13.0
GTK_REQUIRED_VERSION=2.10.0
GNOME_VFS_REQUIRED_VERSION=2.18.0
PANGO_REQUIRED_VERSION=1.3.0
LIBGLADE_REQUIRED_VERSION=1.99.2
SCROLLKEEPER_REQUIRED_VERSION=0.1.4
dnl
dnl Let the user configure where to look for the configuration files.
......@@ -159,64 +160,56 @@ dnl checks needed for Darwin compatibility to linux **environ.
AC_CHECK_HEADERS(crt_externs.h)
AC_CHECK_FUNCS(_NSGetEnviron)
GNOME_COMPILE_WARNINGS
CFLAGS="$CFLAGS $WARN_CFLAGS"
EXTRA_COMPILE_WARNINGS(yes)
PKG_CHECK_MODULES(COMMON, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
PKG_CHECK_MODULES(COMMON,
dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
gobject-2.0 >= $GLIB_REQUIRED_VERSION
)
AC_SUBST(COMMON_CFLAGS)
AC_SUBST(COMMON_LIBS)
PKG_CHECK_MODULES(DAEMON, gtk+-2.0 >= $GTK_REQUIRED)
PKG_CHECK_MODULES(DAEMON,
dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
gobject-2.0 >= $GLIB_REQUIRED_VERSION
x11 >= $X11_REQUIRED_VERSION
)
AC_SUBST(DAEMON_CFLAGS)
AC_SUBST(DAEMON_LIBS)
PKG_CHECK_MODULES(GUI, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED)
AC_SUBST(GUI_CFLAGS)
AC_SUBST(GUI_LIBS)
PKG_CHECK_MODULES(GUIGLADE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
AC_SUBST(GUIGLADE_CFLAGS)
AC_SUBST(GUIGLADE_LIBS)
PKG_CHECK_MODULES(GUING, gtk+-2.0 >= $GTK_REQUIRED)
AC_SUBST(GUING_CFLAGS)
AC_SUBST(GUING_LIBS)
PKG_CHECK_MODULES(GREETER, gtk+-2.0 >= $GTK_REQUIRED)
PKG_CHECK_MODULES(GREETER,
dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
gtk+-2.0 >= $GTK_REQUIRED_VERSION
)
AC_SUBST(GREETER_CFLAGS)
AC_SUBST(GREETER_LIBS)
dnl libbackground
PKG_CHECK_MODULES(CAPPLET, "gtk+-2.0 gconf-2.0")
dnl ==========================================================================
PKG_CHECK_MODULES(UTILS, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
AC_SUBST(UTILS_CFLAGS)
AC_SUBST(UTILS_LIBS)
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)
PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED)
AC_SUBST(PANGO_CFLAGS)
AC_SUBST(PANGO_LIBS)
PKG_CHECK_MODULES(PANGOFT, pangoft2 >= $PANGO_REQUIRED)
AC_SUBST(PANGOFT_CFLAGS)
AC_SUBST(PANGOFT_LIBS)
PKG_CHECK_MODULES(SIMPLE_GREETER,
dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
gtk+-2.0 >= $GTK_REQUIRED_VERSION
libglade-2.0 >= $LIBGLADE_REQUIRED_VERSION
gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION
)
AC_SUBST(SIMPLE_GREETER_CFLAGS)
AC_SUBST(SIMPLE_GREETER_LIBS)
PKG_CHECK_MODULES(GDK, gdk-2.0 >= $GTK_REQUIRED)
AC_SUBST(GDK_CFLAGS)
AC_SUBST(GDK_LIBS)
PKG_CHECK_MODULES(CHOOSER,
dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
gtk+-2.0 >= $GTK_REQUIRED_VERSION
)
AC_SUBST(CHOOSER_CFLAGS)
AC_SUBST(CHOOSER_LIBS)
PKG_CHECK_MODULES(SIMPLE_CHOOSER,
dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
gtk+-2.0 >= $GTK_REQUIRED_VERSION
libglade-2.0 >= $LIBGLADE_REQUIRED_VERSION
gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION
)
AC_SUBST(SIMPLE_CHOOSER_CFLAGS)
AC_SUBST(SIMPLE_CHOOSER_LIBS)
PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0 >= $GTK_REQUIRED)
AC_SUBST(GDKPIXBUF_CFLAGS)
AC_SUBST(GDKPIXBUF_LIBS)
dnl ==========================================================================
dnl Allow users to run gdmsetup using the console helper PAM stuff.
if test "x$enable_console_helper" = "xyes"; then
......@@ -266,9 +259,6 @@ AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton, [
EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lresolv"])])
COMMON_GNOME_LIBS="libgdmcommon-ui.a"
AC_SUBST(COMMON_GNOME_LIBS)
dnl *****************************
dnl IPv6 specific checks
dnl *****************************
......@@ -844,14 +834,7 @@ dnl ---------------------------------------------------------------------------
dnl - D-Bus
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
dnl ---------------------------------------------------------------------------
dnl - Are we specifying a different dbus root ?
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(dbus-sys,
[AC_HELP_STRING([--with-dbus-sys=<dir>],
[where D-BUS system.d directory is])])
......@@ -1329,7 +1312,6 @@ Makefile
daemon/Makefile
libgreeter/Makefile
gui/Makefile
gui/modules/Makefile
gui/simple-greeter/Makefile
gui/simple-greeter/libnotificationarea/Makefile
gui/simple-chooser/Makefile
......
NULL =
# Note that we have cflags for just about everything even if
# we don't link to everything
INCLUDES = \
-I. \
-I.. \
......@@ -21,12 +19,11 @@ INCLUDES = \
-DGDM_DEFAULTS_CONF=\"$(GDM_DEFAULTS_CONF)\" \
-DGDM_CUSTOM_CONF=\"$(GDM_CUSTOM_CONF)\" \
-DGDM_OLD_CONF=\"$(GDM_OLD_CONF)\" \
$(GUI_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
$(DAEMON_CFLAGS) \
$(WARN_CFLAGS) \
$(DEBUG_CFLAGS) \
-DLANG_CONFIG_FILE=\"$(LANG_CONFIG_FILE)\" \
$(GNOME_INCLUDEDIR) \
-DGREETERTHEMEDIR=\""$(datadir)/gdm/themes"\" \
$(DBUS_CFLAGS) \
$(NULL)
BUILT_SOURCES = \
......@@ -74,10 +71,8 @@ test_session_SOURCES = \
$(NULL)
test_session_LDADD = \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(DAEMON_LIBS) \
$(PAM_LIBS) \
$(DBUS_LIBS) \
$(NULL)
libexec_PROGRAMS = \
......@@ -113,23 +108,12 @@ gdm_simple_slave_SOURCES = \
$(NULL)
gdm_simple_slave_LDFLAGS = \
$(EXTRA_SLAVE_LIBS) \
$(PAM_LIBS) \
$(NULL)
gdm_simple_slave_LDADD = \
$(DAEMON_LIBS) \
$(INTLLIBS) \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(GDK_LIBS) \
$(top_builddir)/common/libgdmcommon.la \
$(X_LIBS) \
$(XINERAMA_LIBS) \
$(DBUS_LIBS) \
-lXau \
-lX11 \
-lXext \
$(NULL)
gdm_factory_slave_SOURCES = \
......@@ -159,17 +143,7 @@ gdm_factory_slave_LDFLAGS = \
gdm_factory_slave_LDADD = \
$(DAEMON_LIBS) \
$(INTLLIBS) \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(GDK_LIBS) \
$(top_builddir)/common/libgdmcommon.la \
$(X_LIBS) \
$(XINERAMA_LIBS) \
$(DBUS_LIBS) \
-lXau \
-lX11 \
-lXext \
$(NULL)
gdm_product_slave_SOURCES = \
......@@ -192,23 +166,12 @@ gdm_product_slave_SOURCES = \
$(NULL)
gdm_product_slave_LDFLAGS = \
$(EXTRA_SLAVE_LIBS) \
$(PAM_LIBS) \
$(NULL)
gdm_product_slave_LDADD = \
$(DAEMON_LIBS) \
$(INTLLIBS) \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(GDK_LIBS) \
$(top_builddir)/common/libgdmcommon.la \
$(X_LIBS) \
$(XINERAMA_LIBS) \
$(DBUS_LIBS) \
-lXau \
-lX11 \
-lXext \
$(NULL)
gdm_session_worker_SOURCES = \
......@@ -222,10 +185,8 @@ gdm_session_worker_LDFLAGS = \
$(NULL)
gdm_session_worker_LDADD = \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(DAEMON_LIBS) \
$(top_builddir)/common/libgdmcommon.la \
$(DBUS_LIBS) \
$(NULL)
sbin_PROGRAMS = \
......@@ -289,18 +250,7 @@ gdm_binary_LDFLAGS = \
gdm_binary_LDADD = \
$(DAEMON_LIBS) \
$(INTLLIBS) \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(GDK_LIBS) \
$(top_builddir)/common/libgdmcommon.la \
$(X_LIBS) \
$(XINERAMA_LIBS) \
$(XDMCP_LIBS) \
$(DBUS_LIBS) \
-lXau \
-lX11 \
-lXext \
$(NULL)
if WITH_CONSOLE_KIT
......
......@@ -34,8 +34,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
......@@ -92,21 +90,6 @@ static void gdm_factory_slave_finalize (GObject *object);
G_DEFINE_TYPE (GdmFactorySlave, gdm_factory_slave, GDM_TYPE_SLAVE)
static void
set_busy_cursor (GdmFactorySlave *factory_slave)
{
if (factory_slave->priv->server_display != NULL) {
Cursor xcursor;
xcursor = XCreateFontCursor (factory_slave->priv->server_display, GDK_WATCH);
XDefineCursor (factory_slave->priv->server_display,
DefaultRootWindow (factory_slave->priv->server_display),
xcursor);
XFreeCursor (factory_slave->priv->server_display, xcursor);
XSync (factory_slave->priv->server_display, False);
}
}
static void
gdm_factory_slave_whack_temp_auth_file (GdmFactorySlave *factory_slave)
{
......@@ -627,7 +610,7 @@ run_greeter (GdmFactorySlave *slave)
}
/* Set the busy cursor */
set_busy_cursor (slave);
gdm_slave_set_busy_cursor (GDM_SLAVE (slave));
/* FIXME: send a signal back to the master */
......@@ -709,89 +692,6 @@ run_greeter (GdmFactorySlave *slave)
g_free (auth_file);
}
static void
set_local_auth (GdmFactorySlave *slave)
{
GString *binary_cookie;
GString *cookie;
char *display_x11_cookie;
g_object_get (slave,
"display-x11-cookie", &display_x11_cookie,
NULL);
g_debug ("Setting authorization key for display %s", display_x11_cookie);
cookie = g_string_new (display_x11_cookie);
binary_cookie = g_string_new (NULL);
if (! gdm_string_hex_decode (cookie,
0,
NULL,
binary_cookie,
0)) {
g_warning ("Unable to decode hex cookie");
goto out;
}
g_debug ("Decoded cookie len %d", binary_cookie->len);
XSetAuthorization ("MIT-MAGIC-COOKIE-1",
(int) strlen ("MIT-MAGIC-COOKIE-1"),
(char *)binary_cookie->str,
binary_cookie->len);
out:
g_string_free (binary_cookie, TRUE);
g_string_free (cookie, TRUE);
g_free (display_x11_cookie);
}
static gboolean
connect_to_display (GdmFactorySlave *slave)
{
char *display_name;
gboolean ret;
ret = FALSE;
g_object_get (slave,
"display-name", &display_name,
NULL);
/* We keep our own (windowless) connection (dsp) open to avoid the
* X server resetting due to lack of active connections. */
g_debug ("Server is ready - opening display %s", display_name);
g_setenv ("DISPLAY", display_name, TRUE);
g_unsetenv ("XAUTHORITY"); /* just in case it's set */
set_local_auth (slave);
#if 0
/* X error handlers to avoid the default one (i.e. exit (1)) */
do_xfailed_on_xio_error = TRUE;
XSetErrorHandler (gdm_factory_slave_xerror_handler);
XSetIOErrorHandler (gdm_factory_slave_xioerror_handler);
#endif
gdm_sigchld_block_push ();
slave->priv->server_display = XOpenDisplay (display_name);
gdm_sigchld_block_pop ();
if (slave->priv->server_display == NULL) {
g_warning ("Unable to connect to display %s", display_name);
ret = FALSE;
} else {
g_debug ("Connected to display %s", display_name);
ret = TRUE;
}
g_free (display_name);
return ret;
}
static gboolean
idle_connect_to_display (GdmFactorySlave *slave)
{
......@@ -801,7 +701,7 @@ idle_connect_to_display (GdmFactorySlave *slave)
g_debug ("Connect to display");
res = connect_to_display (slave);
res = gdm_slave_connect_to_x11_display (GDM_SLAVE (slave));
if (res) {
/* FIXME: handle wait-for-go */
......
......@@ -34,8 +34,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
......@@ -100,21 +98,6 @@ static void gdm_product_slave_finalize (GObject *object);
G_DEFINE_TYPE (GdmProductSlave, gdm_product_slave, GDM_TYPE_SLAVE)
static void
set_busy_cursor (GdmProductSlave *product_slave)
{
if (product_slave->priv->server_display != NULL) {
Cursor xcursor;
xcursor = XCreateFontCursor (product_slave->priv->server_display, GDK_WATCH);
XDefineCursor (product_slave->priv->server_display,
DefaultRootWindow (product_slave->priv->server_display),
xcursor);
XFreeCursor (product_slave->priv->server_display, xcursor);
XSync (product_slave->priv->server_display, False);
}
}
static void
gdm_product_slave_whack_temp_auth_file (GdmProductSlave *product_slave)
{
......@@ -615,7 +598,7 @@ setup_server (GdmProductSlave *slave)
NULL);
/* Set the busy cursor */
set_busy_cursor (slave);
gdm_slave_set_busy_cursor (GDM_SLAVE (slave));
/* FIXME: send a signal back to the master */
......@@ -633,96 +616,13 @@ setup_server (GdmProductSlave *slave)
/* Run the init script. gdmslave suspends until script has terminated */
gdm_product_slave_exec_script (slave,
GDMCONFDIR"/Init",
"gdm");
GDMCONFDIR"/Init",
"gdm");
g_free (display_name);
g_free (auth_file);
}
static void
set_local_auth (GdmProductSlave *slave)
{
GString *binary_cookie;
GString *cookie;
char *display_x11_cookie;
g_object_get (slave,
"display-x11-cookie", &display_x11_cookie,
NULL);
g_debug ("Setting authorization key for display %s", display_x11_cookie);
cookie = g_string_new (display_x11_cookie);
binary_cookie = g_string_new (NULL);
if (! gdm_string_hex_decode (cookie,
0,
NULL,
binary_cookie,
0)) {
g_warning ("Unable to decode hex cookie");
goto out;
}
g_debug ("Decoded cookie len %d", binary_cookie->len);
XSetAuthorization ("MIT-MAGIC-COOKIE-1",
(int) strlen ("MIT-MAGIC-COOKIE-1"),
(char *)binary_cookie->str,
binary_cookie->len);
out:
g_string_free (binary_cookie, TRUE);
g_string_free (cookie, TRUE);
g_free (display_x11_cookie);
}
static gboolean
connect_to_display (GdmProductSlave *slave)
{
char *display_name;
gboolean ret;
ret = FALSE;
g_object_get (slave,
"display-name", &display_name,
NULL);
/* We keep our own (windowless) connection (dsp) open to avoid the
* X server resetting due to lack of active connections. */
g_debug ("Server is ready - opening display %s", display_name);
g_setenv ("DISPLAY", display_name, TRUE);
g_unsetenv ("XAUTHORITY"); /* just in case it's set */
set_local_auth (slave);
#if 0
/* X error handlers to avoid the default one (i.e. exit (1)) */
do_xfailed_on_xio_error = TRUE;
XSetErrorHandler (gdm_product_slave_xerror_handler);
XSetIOErrorHandler (gdm_product_slave_xioerror_handler);
#endif
gdm_sigchld_block_push ();
slave->priv->server_display = XOpenDisplay (display_name);
gdm_sigchld_block_pop ();
if (slave->priv->server_display == NULL) {
g_warning ("Unable to connect to display %s", display_name);
ret = FALSE;
} else {
g_debug ("Connected to display %s", display_name);
ret = TRUE;
}
g_free (display_name);
return ret;
}
static gboolean
setup_session (GdmProductSlave *slave)
{
......@@ -767,7 +667,7 @@ idle_connect_to_display (GdmProductSlave *slave)
slave->priv->connection_attempts++;
res = connect_to_display (slave);
res = gdm_slave_connect_to_x11_display (GDM_SLAVE (slave));
if (res) {
/* FIXME: handle wait-for-go */
......
......@@ -34,8 +34,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
......@@ -74,7 +72,6 @@ struct GdmSimpleSlavePrivate
int ping_interval;
GPid server_pid;
Display *server_display;
guint connection_attempts;