- start same kind of AT's in session as started in gdm (#229912)

This commit is contained in:
David Zeuthen 2007-04-12 18:48:53 +00:00
parent ce05bc1970
commit 0dca26d05f
2 changed files with 129 additions and 1 deletions

View File

@ -0,0 +1,121 @@
--- gnome-session/main.c.gdm-hints 2007-04-12 14:31:38.000000000 -0400
+++ gnome-session/main.c 2007-04-12 14:38:56.000000000 -0400
@@ -388,6 +388,12 @@
gconf_client = gsm_get_conf_client ();
gconf_client_add_dir (gconf_client, GSM_GCONF_CONFIG_PREFIX, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
a_t_support = gconf_client_get_bool (gconf_client, ACCESSIBILITY_KEY, NULL);
+ if (g_getenv ("GDM_ATS") != NULL && !a_t_support)
+ {
+ a_t_support = TRUE;
+ gconf_client_set_bool (gconf_client, ACCESSIBILITY_KEY, TRUE, NULL);
+ }
+
if (a_t_support)
{
@@ -436,6 +442,11 @@
autosave = gconf_client_get_bool (gconf_client, AUTOSAVE_MODE_KEY, NULL);
logout_prompt = gconf_client_get_bool (gconf_client, LOGOUT_PROMPT_KEY, NULL);
a_t_support = gconf_client_get_bool (gconf_client, ACCESSIBILITY_KEY, NULL);
+ if (g_getenv ("GDM_ATS") != NULL)
+ {
+ a_t_support = TRUE;
+ }
+
gconf_client_notify_add (gconf_client,
AUTOSAVE_MODE_KEY,
--- gnome-session/gsm-at-startup.c.gdm-hints 2007-04-12 14:31:38.000000000 -0400
+++ gnome-session/gsm-at-startup.c 2007-04-12 14:31:38.000000000 -0400
@@ -17,16 +17,24 @@
static void
gsm_assistive_tech_exec (gchar *exec_string)
{
- gchar *s;
gboolean success;
-
+ char **v;
+
success = FALSE;
- s = g_find_program_in_path (exec_string);
- if (s) {
- success = gsm_exec_command_line_async (exec_string, NULL);
- g_free (s);
+ v = g_strsplit (exec_string, " ", 0);
+ if (v[0] != NULL) {
+ gchar *s;
+ fprintf (stderr, "v[0]='%s'\n", v[0]);
+ s = g_find_program_in_path (v[0]);
+ fprintf (stderr, "s='%s'\n", s);
+ if (s) {
+ success = gsm_exec_command_line_async (exec_string, NULL);
+ fprintf (stderr, "bar %d '%s'\n", success, exec_string);
+ g_free (s);
+ }
}
+ g_strfreev (v);
if (!success && !strcmp (exec_string, "gnopernicus")) {
/* backwards compatibility for 2.14 */
@@ -34,6 +42,33 @@
}
}
+static void
+gsm_assistive_tech_exec_type (gchar *at_type)
+{
+ gchar *at;
+
+ at = NULL;
+
+ fprintf (stderr, "at_type='%s'\n", at_type);
+
+ /* TODO: should
+ *
+ * 1. read from preferred applications in gconf
+ * 2. make sure that AT's execed don't overlap with users choice
+ */
+ if (strcmp (at_type, "screenreader") == 0) {
+ at = "orca";
+ } else if (strcmp (at_type, "magnifier") == 0) {
+ at = "orca -n -d main-window -d speech -e magnifier";
+ } else if (strcmp (at_type, "onscreenkeyboard") == 0) {
+ at = "gok";
+ }
+
+ if (at != NULL) {
+ gsm_assistive_tech_exec (at);
+ }
+}
+
static GdkFilterReturn
gsm_assistive_filter_watch (GdkXEvent *xevent, GdkEvent *event, gpointer data){
XEvent *xev = (XEvent *)xevent;
@@ -103,6 +138,7 @@
GError *error = NULL;
GConfClient *client;
GSList *list;
+ const char *at_suggested_by_gdm;
client = gsm_get_conf_client ();
list = gconf_client_get_list (client, AT_STARTUP_KEY, GCONF_VALUE_STRING, &error);
@@ -122,6 +158,18 @@
}
g_slist_free (list);
}
+
+ /* start AT's if user have started them from gdm */
+ if ((at_suggested_by_gdm = g_getenv ("GDM_ATS")) != NULL) {
+ int i;
+ char **at_list;
+ at_list = g_strsplit (at_suggested_by_gdm, " ", 0);
+ for (i = 0; at_list[i] != NULL; i++) {
+ gsm_assistive_tech_exec_type (at_list[i]);
+ }
+ g_strfreev (at_list);
+ }
+
}
void

View File

@ -12,7 +12,7 @@
Summary: GNOME session manager
Name: gnome-session
Version: 2.18.0
Release: 3%{?dist}
Release: 4%{?dist}
URL: http://www.gnome.org
Source0: http://ftp.gnome.org/pub/gnome/sources/gnome-session/2.18/%{name}-%{version}.tar.bz2
Source1: redhat-default-session
@ -58,6 +58,9 @@ Patch13: gnome-session-2.17.5-window-manager.patch
# don't pop up the dialog as it can take longer than 5 seconds
Patch20: gnome-session-2.17.91-atspi-timeout.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=411506
Patch21: gnome-session-2.17.91-use-gdm-at-hints-3.patch
BuildRequires: esound-devel >= %{esound_version}
BuildRequires: /usr/bin/esd
BuildRequires: libgnomeui-devel >= %{libgnomeui_version}
@ -104,6 +107,7 @@ GNOME components and handles logout and saving the session.
%patch9 -p1 -b .no-crashes
%patch13 -p1 -b .window-manager
%patch20 -p1 -b .timeout
%patch21 -p0 -b .use-gdm-hints
%build
@ -195,6 +199,9 @@ fi
%{_datadir}/icons/hicolor/scalable/apps/session-properties.svg
%changelog
* Thu Apr 12 2007 David Zeuthen <davidz@redhat.com> - 2.18.0-4
- start same kind of AT's in session as started in gdm (#229912)
* Fri Mar 30 2007 Ray Strode <rstrode@redhat.com> - 2.18.0-3
- remove xdg autostart dir since it's part of filesystem now