gnome-settings-daemon-05-sticky-timeout.diff revision 15559
15559N/Adiff -up gnome-settings-daemon-2.21.5/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c.orig gnome-settings-daemon-2.21.5/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c
15559N/A--- gnome-settings-daemon-2.21.5/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c.orig 2007-12-24 11:18:49.000000000 +0000
15559N/A+++ gnome-settings-daemon-2.21.5/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c 2008-01-23 11:30:41.851872000 +0000
15559N/A@@ -77,8 +77,13 @@ impl_activate (GnomeSettingsPlugin *plug
15559N/A error = NULL;
15559N/A res = gsd_a11y_keyboard_manager_start (GSD_A11Y_KEYBOARD_PLUGIN (plugin)->priv->manager, &error);
15559N/A if (! res) {
15559N/A+ if ( error != NULL ) {
15559N/A g_warning ("Unable to start a11y_keyboard manager: %s", error->message);
15559N/A g_error_free (error);
15559N/A+ }
15559N/A+ else {
15559N/A+ g_warning ("Unable to start a11y_keyboard manager.");
15559N/A+ }
15559N/A }
15559N/A }
15559N/A
15559N/A
15559N/A
15559N/A--- gnome-settings-daemon-2.25.2/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c.ori 2008-12-01 11:38:46.000000000 +0000
15559N/A+++ gnome-settings-daemon-2.25.2/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c 2008-12-24 08:25:13.111328473 +0000
15559N/A@@ -654,7 +654,8 @@
13941N/A
13941N/A static gboolean
13941N/A ax_stickykeys_warning_post_bubble (GsdA11yKeyboardManager *manager,
13941N/A- gboolean enabled)
13941N/A+ gboolean enabled,
13941N/A+ gboolean key_pressed)
13941N/A {
13941N/A #ifdef HAVE_LIBNOTIFY
13941N/A gboolean res;
15559N/A@@ -665,11 +666,16 @@
13941N/A title = enabled ?
13941N/A _("Do you want to activate Sticky Keys?") :
13941N/A _("Do you want to deactivate Sticky Keys?");
13941N/A- message = enabled ?
13941N/A- _("You just pressed the Shift key 5 times in a row. This is the shortcut "
13941N/A- "for the Sticky Keys feature, which affects the way your keyboard works.") :
13941N/A- _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
13941N/A- "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ if (enabled) {
13941N/A+ message = _("You just pressed the Shift key 5 times in a row. This is the shortcut "
13941N/A+ "for the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ } else if (key_pressed) {
13941N/A+ message = _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
13941N/A+ "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ } else {
13941N/A+ message = _("Sticky Keys have not been used for a while. This inactivity turns off "
13941N/A+ "the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ }
13941N/A
15559N/A if (manager->priv->status_icon == NULL || ! gtk_status_icon_is_embedded (manager->priv->status_icon)) {
13941N/A return FALSE;
15559N/A@@ -730,7 +736,8 @@
12248N/A
12248N/A static void
13941N/A ax_stickykeys_warning_post_dialog (GsdA11yKeyboardManager *manager,
12248N/A- gboolean enabled)
12248N/A+ gboolean enabled,
12248N/A+ gboolean key_pressed)
12248N/A {
13941N/A const char *title;
13941N/A const char *message;
15559N/A@@ -738,11 +745,16 @@
13941N/A title = enabled ?
13941N/A _("Do you want to activate Sticky Keys?") :
13941N/A _("Do you want to deactivate Sticky Keys?");
13941N/A- message = enabled ?
13941N/A- _("You just pressed the Shift key 5 times in a row. This is the shortcut "
13941N/A- "for the Sticky Keys feature, which affects the way your keyboard works.") :
13941N/A- _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
13941N/A- "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ if (enabled) {
13941N/A+ message = _("You just pressed the Shift key 5 times in a row. This is the shortcut "
13941N/A+ "for the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ } else if (key_pressed) {
13941N/A+ message = _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
13941N/A+ "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ } else {
13941N/A+ message = _("Sticky Keys have not been used for a while. This inactivity turns off "
13941N/A+ "the Sticky Keys feature, which affects the way your keyboard works.");
13941N/A+ }
12248N/A
12248N/A if (manager->priv->stickykeys_alert != NULL) {
12248N/A gtk_widget_show (manager->priv->stickykeys_alert);
15559N/A@@ -787,19 +799,21 @@
13941N/A
13941N/A static void
13941N/A ax_stickykeys_warning_post (GsdA11yKeyboardManager *manager,
13941N/A- gboolean enabled)
13941N/A+ gboolean enabled,
13941N/A+ gboolean key_pressed)
13941N/A {
12248N/A
13941N/A manager->priv->stickykeys_shortcut_val = enabled;
13941N/A
13941N/A /* alway try to show something */
13941N/A- if (! ax_stickykeys_warning_post_bubble (manager, enabled)) {
13941N/A- ax_stickykeys_warning_post_dialog (manager, enabled);
13941N/A+ if (! ax_stickykeys_warning_post_bubble (manager, enabled, key_pressed)) {
13941N/A+ ax_stickykeys_warning_post_dialog (manager, enabled, key_pressed);
13941N/A }
12248N/A }
12248N/A
12248N/A static void
12248N/A-set_gconf_from_server (GsdA11yKeyboardManager *manager)
13941N/A+set_gconf_from_server (GsdA11yKeyboardManager *manager,
13941N/A+ gboolean key_pressed)
12248N/A {
12248N/A GConfClient *client;
12248N/A GConfChangeSet *cs;
15559N/A@@ -926,7 +940,7 @@
13941N/A desc->ctrls->enabled_ctrls & XkbSlowKeysMask);
12248N/A } else {
13941N/A ax_stickykeys_warning_post (manager,
13941N/A- desc->ctrls->enabled_ctrls & XkbStickyKeysMask);
13941N/A+ desc->ctrls->enabled_ctrls & XkbStickyKeysMask, key_pressed);
12248N/A }
12248N/A }
12248N/A }
15559N/A@@ -951,11 +965,12 @@
12248N/A {
12248N/A XEvent *xev = (XEvent *) xevent;
12248N/A XkbEvent *xkbEv = (XkbEvent *) xevent;
12248N/A+ static gboolean key_pressed = FALSE;
12248N/A
12248N/A if (xev->xany.type == (manager->priv->xkbEventBase + XkbEventCode) &&
12248N/A xkbEv->any.xkb_type == XkbControlsNotify) {
13290N/A d ("XKB state changed");
12248N/A- set_gconf_from_server (manager);
13941N/A+ set_gconf_from_server (manager, key_pressed);
12248N/A } else if (xev->xany.type == (manager->priv->xkbEventBase + XkbEventCode) &&
12248N/A xkbEv->any.xkb_type == XkbAccessXNotify) {
12248N/A if (xkbEv->accessx.detail == XkbAXN_AXKWarning) {
15559N/A@@ -966,6 +981,9 @@
13941N/A * set_gconf_from_server().
12248N/A */
12248N/A }
13941N/A+ } else if (xev->xany.type == (manager->priv->xkbEventBase + XkbEventCode) &&
13941N/A+ xkbEv->any.xkb_type == XkbStateNotify) {
13941N/A+ key_pressed = TRUE;
12248N/A }
12248N/A
12248N/A return GDK_FILTER_CONTINUE;
15559N/A@@ -1012,7 +1030,7 @@
13290N/A (GConfClientNotifyFunc) keyboard_callback,
13290N/A &manager->priv->gconf_notify);
12248N/A
12248N/A- event_mask = XkbControlsNotifyMask;
12248N/A+ event_mask = XkbControlsNotifyMask | XkbStateNotifyMask;
12248N/A #ifdef DEBUG_ACCESSIBILITY
12248N/A event_mask |= XkbAccessXNotifyMask; /* make default when AXN_AXKWarning works */
12248N/A #endif