gdm/gdm-2.17.7-pass-at-to-session-4.patch

280 lines
9.4 KiB
Diff
Raw Normal View History

Index: gui/modules/dwellmouselistener.c
===================================================================
--- gui/modules/dwellmouselistener.c (revision 4608)
+++ gui/modules/dwellmouselistener.c (working copy)
@@ -665,6 +665,8 @@
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);
@@ -673,6 +675,26 @@
latch_core_pointer = FALSE;
/* once we've recognized a gesture, we need to *
* leave the pointer alone */
+
+ 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);
+ }
}
}
}
Index: gui/modules/keymouselistener.c
===================================================================
--- gui/modules/keymouselistener.c (revision 4608)
+++ gui/modules/keymouselistener.c (working copy)
@@ -937,6 +937,8 @@
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);
@@ -944,6 +946,26 @@
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;
Index: gui/modules/AccessDwellMouseEvents.in
===================================================================
--- gui/modules/AccessDwellMouseEvents.in (revision 4608)
+++ gui/modules/AccessDwellMouseEvents.in (working copy)
@@ -37,23 +37,23 @@
# 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
# Orca. Note these gestures all start by moving the mouse into the
# bottom window border.
#
# 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
Index: gui/modules/AccessKeyMouseEvents.in
===================================================================
--- gui/modules/AccessKeyMouseEvents.in (revision 4608)
+++ gui/modules/AccessKeyMouseEvents.in (working copy)
@@ -69,18 +69,18 @@
# 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
# Start GOK with direct selection mode.
#
-<Control>k 5 1000 10000 @AT_BINDIR@/gok --login --access-method=directselection
+<Control>k 5 1000 10000 @AT_BINDIR@/gok --login --access-method=directselection #AT_TYPE=onscreenkeyboard
Index: gui/greeter/greeter.c
===================================================================
--- gui/greeter/greeter.c (revision 4608)
+++ gui/greeter/greeter.c (working copy)
@@ -340,6 +340,19 @@
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:
language = greeter_language_get_language (args);
if (greeter_language_get_save_language () == GTK_RESPONSE_CANCEL)
Index: daemon/gdm.h
===================================================================
--- daemon/gdm.h (revision 4608)
+++ daemon/gdm.h (working copy)
@@ -98,6 +98,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_RESET 'A'
Index: daemon/slave.c
===================================================================
--- daemon/slave.c (revision 4608)
+++ daemon/slave.c (working copy)
@@ -3430,6 +3430,7 @@
const char *session,
const char *save_session,
const char *language,
+ const char *a11y_ats,
const char *gnome_session,
gboolean usrcfgok,
gboolean savesess,
@@ -3522,6 +3523,9 @@
g_setenv ("XDG_SESSION_COOKIE", ck_session_cookie, TRUE);
}
#endif
+ 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);
@@ -4016,7 +4020,7 @@
{
struct passwd *pwent;
const char *home_dir = NULL;
- char *save_session = NULL, *session = NULL, *language = NULL, *usrsess, *usrlang;
+ char *save_session = NULL, *session = NULL, *language = NULL, *a11y_ats = NULL, *usrsess, *usrlang;
char *gnome_session = NULL;
#ifdef WITH_CONSOLE_KIT
char *ck_session_cookie;
@@ -4187,9 +4191,19 @@
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");
@@ -4210,11 +4224,16 @@
language = NULL;
}
+ if G_LIKELY (ve_string_empty (a11y_ats)) {
+ g_free (a11y_ats);
+ a11y_ats = NULL;
+ }
+
g_free (usrsess);
g_free (usrlang);
- gdm_debug ("Initial setting: session: '%s' language: '%s'\n",
- session, ve_sure_string (language));
+ gdm_debug ("Initial setting: session: '%s' language: '%s' 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);
@@ -4378,6 +4397,7 @@
session,
save_session,
language,
+ a11y_ats,
gnome_session,
usrcfgok,
savesess,
--- gui/gdmlogin.c.orig 2007-03-19 23:32:04.000000000 -0400
+++ gui/gdmlogin.c 2007-03-19 23:32:33.000000000 -0400
@@ -1784,6 +1784,19 @@
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_login_language_lookup (args);
if (savelang == GTK_RESPONSE_CANCEL)