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

Start atspi-registryd and xsettings manager.

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

	* configure.ac:
	* gui/simple-greeter/Makefile.am:
	* gui/simple-greeter/gdm-greeter-background.c:
	(gdm_greeter_background_real_map), (gdm_greeter_background_init):
	* gui/simple-greeter/gdm-greeter-login-window.c:
	(gdm_greeter_login_window_init):
	* gui/simple-greeter/gdm-greeter-session.c:
	(start_settings_daemon), (gdm_greeter_session_set_level):
	* gui/simple-greeter/greeter-main.c: (assistive_registry_launch),
	(filter_watch), (filter_timeout), (assistive_registry_start),
	(at_set_gtk_modules), (main):
	Start atspi-registryd and xsettings manager.


svn path=/trunk/; revision=5402
parent 8c1e2de4
2007-10-24 William Jon McCann <mccann@jhu.edu>
* configure.ac:
* gui/simple-greeter/Makefile.am:
* gui/simple-greeter/gdm-greeter-background.c:
(gdm_greeter_background_real_map), (gdm_greeter_background_init):
* gui/simple-greeter/gdm-greeter-login-window.c:
(gdm_greeter_login_window_init):
* gui/simple-greeter/gdm-greeter-session.c:
(start_settings_daemon), (gdm_greeter_session_set_level):
* gui/simple-greeter/greeter-main.c: (assistive_registry_launch),
(filter_watch), (filter_timeout), (assistive_registry_start),
(at_set_gtk_modules), (main):
Start atspi-registryd and xsettings manager.
2007-10-24 William Jon McCann <mccann@jhu.edu>
* gui/simple-greeter/gdm-greeter-login-window.c: (show_widget),
......
......@@ -153,6 +153,14 @@ AC_ARG_WITH(console-kit,
[ --with-console-kit=[auto/yes/no] Add ConsoleKit support [default=auto]],,
with_console_kit=auto)
AC_ARG_WITH(at-spi-registryd-directory,
[AC_HELP_STRING([--with-at-spi-registryd-directory],
[Specify the directory of at-spi-registryd @<:@default=libexecdir@:>@])],,
[with_at_spi_registryd_directory="\${libexecdir}"])
AT_SPI_REGISTRYD_DIR=$with_at_spi_registryd_directory
AC_SUBST(AT_SPI_REGISTRYD_DIR)
# On Solaris, Xnest is only shipped in /usr/openwin/, but your
# should use "--with-post-path=/usr/openwin/bin" for full
# Xserver support (such as access to Xnest and other X executables
......
......@@ -17,6 +17,7 @@ INCLUDES = \
-DGLADEDIR=\""$(pkgdatadir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DSBINDIR=\""$(sbindir)"\" \
-DAT_SPI_REGISTRYD_DIR="\"$(AT_SPI_REGISTRYD_DIR)\"" \
$(GREETER_CFLAGS) \
$(SIMPLE_GREETER_CFLAGS) \
$(NULL)
......
......@@ -625,8 +625,6 @@ gdm_greeter_background_real_map (GtkWidget *widget)
if (GTK_WIDGET_CLASS (gdm_greeter_background_parent_class)->map) {
GTK_WIDGET_CLASS (gdm_greeter_background_parent_class)->map (widget);
}
/*gdk_window_lower (widget->window);*/
}
static void
......@@ -861,13 +859,13 @@ gdm_greeter_background_init (GdmGreeterBackground *background)
{
background->priv = GDM_GREETER_BACKGROUND_GET_PRIVATE (background);
gtk_window_set_keep_below (GTK_WINDOW (background), TRUE);
gtk_window_set_decorated (GTK_WINDOW (background), FALSE);
gtk_widget_set_app_paintable (GTK_WIDGET (background), TRUE);
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (background), TRUE);
gtk_window_set_skip_pager_hint (GTK_WINDOW (background), TRUE);
gtk_window_set_type_hint (GTK_WINDOW (background), GDK_WINDOW_TYPE_HINT_DESKTOP);
gtk_window_fullscreen (GTK_WINDOW (background));
g_signal_connect (background, "delete_event", G_CALLBACK (on_delete_event), NULL);
}
......
......@@ -868,6 +868,7 @@ gdm_greeter_login_window_init (GdmGreeterLoginWindow *login_window)
load_theme (login_window);
gtk_window_set_keep_above (GTK_WINDOW (login_window), TRUE);
gtk_window_set_opacity (GTK_WINDOW (login_window), 0.75);
gtk_window_set_position (GTK_WINDOW (login_window), GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_set_deletable (GTK_WINDOW (login_window), FALSE);
......
......@@ -324,6 +324,30 @@ start_window_manager (GdmGreeterSession *session)
}
}
static gboolean
start_settings_daemon (GdmGreeterSession *session)
{
GError *error;
gboolean ret;
g_debug ("Launching settings daemon");
ret = FALSE;
error = NULL;
g_spawn_command_line_async (LIBEXECDIR "/gnome-settings-daemon", &error);
if (error != NULL) {
g_warning ("Error starting settings daemon: %s", error->message);
g_error_free (error);
goto out;
}
ret = TRUE;
out:
return ret;
}
static void
gdm_greeter_session_set_level (GdmGreeterSession *session,
GdmGreeterSessionLevel level)
......@@ -332,13 +356,14 @@ gdm_greeter_session_set_level (GdmGreeterSession *session,
case GDM_GREETER_SESSION_LEVEL_NONE:
break;
case GDM_GREETER_SESSION_LEVEL_STARTUP:
start_settings_daemon (session);
start_window_manager (session);
start_background (session);
break;
case GDM_GREETER_SESSION_LEVEL_CONFIGURATION:
start_panel (session);
break;
case GDM_GREETER_SESSION_LEVEL_LOGIN_WINDOW:
start_panel (session);
start_login_window (session);
break;
case GDM_GREETER_SESSION_LEVEL_SHUTDOWN:
......
......@@ -22,10 +22,14 @@
#include <stdlib.h>
#include <locale.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
#include "gdm-log.h"
#include "gdm-settings-client.h"
......@@ -33,6 +37,10 @@
#include "gdm-greeter-session.h"
#define ACCESSIBILITY_KEY "/desktop/gnome/interface/accessibility"
static Atom AT_SPI_IOR;
static void
set_fatal_warnings (void)
{
......@@ -50,12 +58,168 @@ set_fatal_warnings (void)
g_strfreev (versions);
}
static gboolean
assistive_registry_launch (void)
{
GPid pid;
GError *error;
const char *command;
char **argv;
gboolean res;
command = AT_SPI_REGISTRYD_DIR "/at-spi-registryd";
argv = NULL;
error = NULL;
res = g_shell_parse_argv (command, NULL, &argv, &error);
if (! res) {
g_warning ("Unable to parse command: %s", error->message);
return FALSE;
}
error = NULL;
res = g_spawn_async (NULL,
argv,
NULL,
G_SPAWN_SEARCH_PATH
| G_SPAWN_STDOUT_TO_DEV_NULL
| G_SPAWN_STDERR_TO_DEV_NULL,
NULL,
NULL,
&pid,
&error);
g_strfreev (argv);
if (! res) {
g_warning ("Unable to run command %s: %s", command, error->message);
return FALSE;
}
if (kill (pid, 0) < 0) {
g_warning ("at-spi-registryd not running");
return FALSE;
}
return TRUE;
}
static GdkFilterReturn
filter_watch (GdkXEvent *xevent,
GdkEvent *event,
gpointer data)
{
XEvent *xev = (XEvent *)xevent;
if (xev->xany.type == PropertyNotify
&& xev->xproperty.atom == AT_SPI_IOR) {
gtk_main_quit ();
return GDK_FILTER_REMOVE;
}
return GDK_FILTER_CONTINUE;
}
static gboolean
filter_timeout (gpointer data)
{
g_warning ("The accessibility registry was not found.");
gtk_main_quit ();
return FALSE;
}
static void
assistive_registry_start (void)
{
GdkWindow *root;
guint tid;
root = gdk_get_default_root_window ();
if ( ! AT_SPI_IOR) {
AT_SPI_IOR = XInternAtom (GDK_DISPLAY (), "AT_SPI_IOR", False);
}
gdk_window_set_events (root, GDK_PROPERTY_CHANGE_MASK);
if ( ! assistive_registry_launch ()) {
g_warning ("The accessibility registry could not be started.");
return;
}
gdk_window_add_filter (root, filter_watch, NULL);
tid = g_timeout_add_seconds (5, filter_timeout, NULL);
gtk_main ();
gdk_window_remove_filter (root, filter_watch, NULL);
g_source_remove (tid);
}
static void
at_set_gtk_modules (void)
{
GSList *modules_list;
GSList *l;
const char *old;
char **modules;
gboolean found_gail;
gboolean found_atk_bridge;
int n;
n = 0;
modules_list = NULL;
found_gail = FALSE;
found_atk_bridge = FALSE;
if ((old = g_getenv ("GTK_MODULES")) != NULL) {
modules = g_strsplit (old, ":", -1);
for (n = 0; modules[n]; n++) {
if (!strcmp (modules[n], "gail")) {
found_gail = TRUE;
} else if (!strcmp (modules[n], "atk-bridge")) {
found_atk_bridge = TRUE;
}
modules_list = g_slist_prepend (modules_list, modules[n]);
modules[n] = NULL;
}
g_free (modules);
}
if (!found_gail) {
modules_list = g_slist_prepend (modules_list, "gail");
++n;
}
if (!found_atk_bridge) {
modules_list = g_slist_prepend (modules_list, "atk-bridge");
++n;
}
modules = g_new (char *, n + 1);
modules[n--] = NULL;
for (l = modules_list; l; l = l->next) {
modules[n--] = g_strdup (l->data);
}
g_setenv ("GTK_MODULES", g_strjoinv (":", modules), TRUE);
g_strfreev (modules);
g_slist_free (modules_list);
}
int
main (int argc, char *argv[])
{
GError *error;
GdmGreeterSession *session;
gboolean res;
const char *env_a_t_support;
gboolean a_t_support;
GConfClient *gconf_client;
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
......@@ -77,13 +241,27 @@ main (int argc, char *argv[])
g_getenv ("XAUTHORITY"));
/* FIXME: For testing to make it easier to attach gdb */
sleep (15);
/*sleep (15);*/
gdm_log_init ();
gdm_log_set_debug (TRUE);
gdk_init (&argc, &argv);
/*gdm_common_atspi_launch ();*/
gconf_client = gconf_client_get_default ();
env_a_t_support = g_getenv ("GNOME_ACCESSIBILITY");
if (env_a_t_support) {
a_t_support = atoi (env_a_t_support);
} else {
a_t_support = gconf_client_get_bool (gconf_client, ACCESSIBILITY_KEY, NULL);
}
if (a_t_support) {
assistive_registry_start ();
at_set_gtk_modules ();
}
gtk_init (&argc, &argv);
session = gdm_greeter_session_new ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment