diff -aur lightdm-gtk-greeter-1.3.1.src/data/greeter.ui lightdm-gtk-greeter-1.3.1.patch/data/greeter.ui --- lightdm-gtk-greeter-1.3.1.src/data/greeter.ui 2012-07-31 08:05:50.000000000 +1000 +++ lightdm-gtk-greeter-1.3.1.patch/data/greeter.ui 2012-09-01 14:43:51.034601664 +1000 @@ -224,6 +224,7 @@ True False rtl + 40 power_menuitem @@ -310,6 +311,15 @@ + + + True + False + False + On Screen Keyboard + + + diff -aur lightdm-gtk-greeter-1.3.1.src/data/lightdm-gtk-greeter.conf lightdm-gtk-greeter-1.3.1.patch/data/lightdm-gtk-greeter.conf --- lightdm-gtk-greeter-1.3.1.src/data/lightdm-gtk-greeter.conf 2012-08-24 03:29:44.000000000 +1000 +++ lightdm-gtk-greeter-1.3.1.patch/data/lightdm-gtk-greeter.conf 2012-09-01 14:46:24.969861911 +1000 @@ -1,9 +1,11 @@ # +# [greeter] # logo = Logo file to use, either an image absolute path, or a path relative to the greeter data directory # background = Background file to use, either an image path or a color (e.g. #772953) # theme-name = GTK+ theme to use # icon-theme-name = Icon theme to use # font-name = Font to use +# cursor-name = Cursor theme to use # xft-antialias = Whether to antialias Xft fonts (true or false) # xft-dpi = Resolution for Xft in dots per inch (e.g. 96) # xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull) @@ -16,8 +18,15 @@ #theme-name= #icon-theme-name= #font-name= +#cursor-name= #xft-antialias= #xft-dpi= #xft-hintstyle= #xft-rgba= #show-language-selector= +# +# [a11y] +# keyboard = Command to launch on screen keyboard +# +[a11y] +#keyboard= diff -aur lightdm-gtk-greeter-1.3.1.src/src/lightdm-gtk-greeter.c lightdm-gtk-greeter-1.3.1.patch/src/lightdm-gtk-greeter.c --- lightdm-gtk-greeter-1.3.1.src/src/lightdm-gtk-greeter.c 2012-08-31 03:39:09.000000000 +1000 +++ lightdm-gtk-greeter-1.3.1.patch/src/lightdm-gtk-greeter.c 2012-09-01 14:55:10.381397437 +1000 @@ -16,6 +16,7 @@ #include #include #include +#include #include "lightdm.h" @@ -32,6 +33,10 @@ static GtkComboBox *language_combo; static gchar *default_font_name, *default_theme_name, *default_icon_theme_name; static gboolean cancelling = FALSE, prompted = FALSE; +static gchar **a11y_keyboard_command; +static int a11y_kbd_pid = 0; +static GPid *a11y_keyboard_pid = &a11y_kbd_pid; +static GError *a11y_keyboard_error; static gchar * get_session () @@ -378,7 +383,15 @@ if (lightdm_greeter_get_is_authenticated (greeter)) { if (prompted) - start_session (); + { + if (a11y_kbd_pid != 0) + { + kill (a11y_kbd_pid, SIGTERM); + g_spawn_close_pid(*a11y_keyboard_pid); + a11y_kbd_pid = 0; + } + start_session (); + } } else { @@ -602,6 +615,32 @@ } } +void a11y_keyboard_cb (GtkWidget *widget); +G_MODULE_EXPORT +void +a11y_keyboard_cb (GtkWidget *widget) +{ + if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) + { + if (!g_spawn_async(NULL, a11y_keyboard_command, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, a11y_keyboard_pid, &a11y_keyboard_error)) + { + g_debug ("a11y keyboard command error : '%s'", a11y_keyboard_error->message); + a11y_kbd_pid = 0; + g_clear_error(&a11y_keyboard_error); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), FALSE); + } + } + else + { + if (a11y_kbd_pid != 0) + { + kill (a11y_kbd_pid, SIGTERM); + g_spawn_close_pid(*a11y_keyboard_pid); + a11y_kbd_pid = 0; + } + } +} + static void sigterm_cb (int signum) { @@ -886,6 +925,13 @@ g_object_set (gtk_settings_get_default (), "gtk-xft-rgba", value, NULL); g_free (value); + /* Get a11y on screen keyboard command*/ + gint argp; + value = g_key_file_get_value (config, "a11y", "keyboard", NULL); + g_debug ("a11y keyboard command is '%s'", value); + g_shell_parse_argv (value, &argp, &a11y_keyboard_command, NULL); + g_free (value); + builder = gtk_builder_new (); if (!gtk_builder_add_from_file (builder, GREETER_DATA_DIR "/greeter.ui", &error)) {