gdm/gdm-2.19.6-pass-ats-to-session.patch

266 lines
10 KiB
Diff
Raw Normal View History

2007-08-16 03:35:12 +00:00
diff -up gdm-2.19.6/gui/gdmlogin.c.pass-ats-to-session gdm-2.19.6/gui/gdmlogin.c
--- gdm-2.19.6/gui/gdmlogin.c.pass-ats-to-session 2007-08-15 23:16:09.000000000 -0400
+++ gdm-2.19.6/gui/gdmlogin.c 2007-08-15 23:16:09.000000000 -0400
@@ -1570,6 +1570,19 @@ process_operation (guchar op_code,
fflush (stdout);
break;
+ case GDM_A11Y:
+ {
+ const char *ats_launched;
+ /* print out the assistive technologies that we've started for the user */
+ ats_launched = g_getenv ("GDM_ATS");
+ if (ats_launched != NULL)
+ printf ("%c%s\n", STX, ats_launched);
+ else
+ printf ("%c\n", STX);
+ fflush (stdout);
+ break;
+ }
+
case GDM_LANG:
gdm_lang_op_lang (args);
break;
diff -up gdm-2.19.6/gui/modules/dwellmouselistener.c.pass-ats-to-session gdm-2.19.6/gui/modules/dwellmouselistener.c
--- gdm-2.19.6/gui/modules/dwellmouselistener.c.pass-ats-to-session 2007-08-15 14:14:07.000000000 -0400
+++ gdm-2.19.6/gui/modules/dwellmouselistener.c 2007-08-15 23:25:29.000000000 -0400
@@ -601,11 +601,33 @@ leave_enter_emission_hook (GSignalInvoca
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
} else {
+ const char *at_name;
+ const char *ats_launched;
GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (gdk_get_default_root_window (),
cursor);
gdk_cursor_unref (cursor);
g_timeout_add (2000, change_cursor_back, NULL);
+
+ at_name = strstr (action, "#AT_TYPE=");
+ if (at_name != NULL) {
+ int i;
+ char **v;
+ at_name += 9;
+ v = g_strsplit (at_name, " ", 0);
+ for (i = 0; v[i] != NULL; i++) {
+ ats_launched = g_getenv ("GDM_ATS");
+ if (ats_launched == NULL) {
+ g_setenv ("GDM_ATS", v[i], TRUE);
+ } else if (strstr (ats_launched, v[i]) == NULL) {
+ char *s;
+ s = g_strdup_printf ("%s %s", ats_launched, v[i]);
+ g_setenv ("GDM_ATS", s, TRUE);
+ g_free (s);
+ }
+ }
+ g_strfreev (v);
+ }
}
}
}
diff -up gdm-2.19.6/gui/modules/AccessKeyMouseEvents.in.pass-ats-to-session gdm-2.19.6/gui/modules/AccessKeyMouseEvents.in
--- gdm-2.19.6/gui/modules/AccessKeyMouseEvents.in.pass-ats-to-session 2007-08-15 14:14:07.000000000 -0400
+++ gdm-2.19.6/gui/modules/AccessKeyMouseEvents.in 2007-08-15 23:16:09.000000000 -0400
@@ -78,14 +78,14 @@
#
# press ctrl-s for 1 second to launch orca in speech mode
#
-<Control>s 1 1000 10000 @AT_BINDIR@/orca -n -d main-window
+<Control>s 1 1000 10000 @AT_BINDIR@/orca -n -d main-window #AT_TYPE=screenreader
# press ctrl-m for 1 second to launch orca in mag mode
#
-<Control>m 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -d speech -e magnifier
+<Control>m 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -d speech -e magnifier #AT_TYPE=magnifier
# press ctrl-o or ctrl-g for 1 second to launch orca in speech and mag mode
#
-<Control>o 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier
-<Control>g 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier
+<Control>o 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier #AT_TYPE=screenreader magnifier
+<Control>g 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier #AT_TYPE=screenreader magnifier
diff -up gdm-2.19.6/gui/modules/AccessDwellMouseEvents.in.pass-ats-to-session gdm-2.19.6/gui/modules/AccessDwellMouseEvents.in
--- gdm-2.19.6/gui/modules/AccessDwellMouseEvents.in.pass-ats-to-session 2007-08-15 14:14:07.000000000 -0400
+++ gdm-2.19.6/gui/modules/AccessDwellMouseEvents.in 2007-08-15 23:16:09.000000000 -0400
@@ -38,10 +38,10 @@
# Support several different options for different user needs. Note these
# gestures all start by moving the mouse into the top window border.
#
-TBLR I 10000 @AT_BINDIR@/gok --login --access-method=dwellselection
-TLBR I 10000 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch1 --select-action=switch1
-TRBL I 10000 @AT_BINDIR@/gok --login --access-method=inversescanning --scan-action=switch1 --select-action=switch2
-TBRL I 10000 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch3 --select-action=switch3
+TBLR I 10000 @AT_BINDIR@/gok --login --access-method=dwellselection #AT_TYPE=onscreenkeyboard
+TLBR I 10000 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch1 --select-action=switch1 #AT_TYPE=onscreenkeyboard
+TRBL I 10000 @AT_BINDIR@/gok --login --access-method=inversescanning --scan-action=switch1 --select-action=switch2 #AT_TYPE=onscreenkeyboard
+TBRL I 10000 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch3 --select-action=switch3 #AT_TYPE=onscreenkeyboard
# AT Program - ORCA
#
@@ -50,13 +50,13 @@ TBRL I 10000 @AT_BINDIR@/gok --login
#
# Speech
#
-BTRL I 10000 @AT_BINDIR@/orca -n -d main-window
+BTRL I 10000 @AT_BINDIR@/orca -n -d main-window #AT_TYPE=screenreader
# Magnifier
#
-BTLR I 10000 @AT_BINDIR@/orca -n -d main-window -d speech -e magnifier
+BTLR I 10000 @AT_BINDIR@/orca -n -d main-window -d speech -e magnifier #AT_TYPE=magnifier
# Speech and Magnifier
#
-BRTL I 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier
+BRTL I 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier #AT_TYPE=screenreader magnifier
diff -up gdm-2.19.6/gui/modules/keymouselistener.c.pass-ats-to-session gdm-2.19.6/gui/modules/keymouselistener.c
--- gdm-2.19.6/gui/modules/keymouselistener.c.pass-ats-to-session 2007-08-15 14:14:07.000000000 -0400
+++ gdm-2.19.6/gui/modules/keymouselistener.c 2007-08-15 23:16:09.000000000 -0400
@@ -953,6 +953,8 @@ gestures_filter (GdkXEvent *gdk_xevent,
NULL);
gtk_widget_show (dialog);
} else {
+ char *at_name;
+ const char *ats_launched;
GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (gdk_get_default_root_window (),
cursor);
@@ -960,6 +962,26 @@ gestures_filter (GdkXEvent *gdk_xevent,
g_timeout_add (2000,
change_cursor_back,
NULL);
+
+ at_name = strstr (action, "#AT_TYPE=");
+ if (at_name != NULL) {
+ int i;
+ char **v;
+ at_name += 9;
+ v = g_strsplit (at_name, " ", 0);
+ for (i = 0; v[i] != NULL; i++) {
+ ats_launched = g_getenv ("GDM_ATS");
+ if (ats_launched == NULL) {
+ g_setenv ("GDM_ATS", v[i], TRUE);
+ } else if (strstr (ats_launched, v[i]) == NULL) {
+ char *s;
+ s = g_strdup_printf ("%s %s", ats_launched, v[i]);
+ g_setenv ("GDM_ATS", s, TRUE);
+ g_free (s);
+ }
+ }
+ g_strfreev (v);
+ }
}
}
return GDK_FILTER_CONTINUE;
diff -up gdm-2.19.6/gui/greeter/greeter.c.pass-ats-to-session gdm-2.19.6/gui/greeter/greeter.c
--- gdm-2.19.6/gui/greeter/greeter.c.pass-ats-to-session 2007-08-15 23:16:08.000000000 -0400
+++ gdm-2.19.6/gui/greeter/greeter.c 2007-08-15 23:16:09.000000000 -0400
@@ -390,6 +390,19 @@ process_operation (guchar op_code,
g_free (session);
break;
+ case GDM_A11Y:
+ {
+ const char *ats_launched;
+ /* print out the assistive technologies that we've started for the user */
+ ats_launched = g_getenv ("GDM_ATS");
+ if (ats_launched != NULL)
+ printf ("%c%s\n", STX, ats_launched);
+ else
+ printf ("%c\n", STX);
+ fflush (stdout);
+ break;
+ }
+
case GDM_LANG:
gdm_lang_op_lang (args);
break;
diff -up gdm-2.19.6/daemon/gdm-socket-protocol.h.pass-ats-to-session gdm-2.19.6/daemon/gdm-socket-protocol.h
--- gdm-2.19.6/daemon/gdm-socket-protocol.h.pass-ats-to-session 2007-08-15 23:16:08.000000000 -0400
+++ gdm-2.19.6/daemon/gdm-socket-protocol.h 2007-08-15 23:16:09.000000000 -0400
@@ -41,6 +41,7 @@
#define GDM_PROMPT 'N'
#define GDM_SESS 'G'
#define GDM_LANG '&'
+#define GDM_A11Y 'Z'
#define GDM_SSESS 'C'
#define GDM_SLANG 'R'
#define GDM_SETLANG 'L'
diff -up gdm-2.19.6/daemon/slave.c.pass-ats-to-session gdm-2.19.6/daemon/slave.c
--- gdm-2.19.6/daemon/slave.c.pass-ats-to-session 2007-08-15 23:16:08.000000000 -0400
+++ gdm-2.19.6/daemon/slave.c 2007-08-15 23:16:09.000000000 -0400
@@ -3575,6 +3575,7 @@ session_child_run (struct passwd *pwent,
const char *session,
const char *save_session,
const char *language,
+ const char *a11y_ats,
const char *gnome_session,
gboolean usrcfgok,
gboolean savesess,
@@ -3667,6 +3668,9 @@ session_child_run (struct passwd *pwent,
}
#endif
g_setenv ("PWD", home_dir, TRUE);
+ if (a11y_ats != NULL) {
+ g_setenv ("GDM_ATS", a11y_ats, TRUE);
+ }
g_setenv ("GDMSESSION", session, TRUE);
g_setenv ("DESKTOP_SESSION", session, TRUE);
g_setenv ("SHELL", pwent->pw_shell, TRUE);
@@ -4454,6 +4458,7 @@ gdm_slave_session_start (void)
struct passwd *pwent;
const char *home_dir = NULL;
char *save_session = NULL, *session = NULL, *language = NULL, *usrsess, *usrlang;
+ char *a11y_ats = NULL;
char *gnome_session = NULL;
#ifdef WITH_CONSOLE_KIT
char *ck_session_cookie;
@@ -4622,9 +4627,19 @@ gdm_slave_session_start (void)
g_free (usrlang);
return;
}
+
+ a11y_ats = gdm_slave_greeter_ctl (GDM_A11Y, NULL);
+ if (a11y_ats != NULL &&
+ strcmp (a11y_ats, GDM_RESPONSE_CANCEL) == 0) {
+ gdm_debug ("User canceled login");
+ gdm_verify_cleanup (d);
+ session_started = FALSE;
+ return;
+ }
} else {
session = g_strdup (usrsess);
language = g_strdup (usrlang);
+ a11y_ats = NULL;
}
tmp = gdm_strip_extension (session, ".desktop");
@@ -4645,10 +4660,15 @@ gdm_slave_session_start (void)
language = NULL;
}
+ if G_LIKELY (ve_string_empty (a11y_ats)) {
+ g_free (a11y_ats);
+ a11y_ats = NULL;
+ }
+
g_free (usrsess);
- gdm_debug ("Initial setting: session: '%s' language: '%s'\n",
- session, ve_sure_string (language));
+ gdm_debug ("Initial setting: session: '%s' language: '%s'i ATs enabled in gdm: '%s'\n",
+ session, ve_sure_string (language), ve_sure_string (a11y_ats));
/* save this session as the users session */
save_session = g_strdup (session);
@@ -4840,6 +4860,7 @@ gdm_slave_session_start (void)
session,
save_session,
lang,
+ a11y_ats,
gnome_session,
usrcfgok,
savesess,