14905
|
1 |
/jds/bin/diff -uprN gnome-settings-daemon-2.25.3.old/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c gnome-settings-daemon-2.25.3/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c
|
|
2 |
--- gnome-settings-daemon-2.25.3.old/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c 2009-01-13 15:26:10.510762000 +0000
|
|
3 |
+++ gnome-settings-daemon-2.25.3/plugins/a11y-keyboard/gsd-a11y-keyboard-plugin.c 2009-01-13 15:27:08.195002000 +0000
|
|
4 |
@@ -77,8 +77,12 @@ impl_activate (GnomeSettingsPlugin *plug
|
14808
|
5 |
error = NULL;
|
|
6 |
res = gsd_a11y_keyboard_manager_start (GSD_A11Y_KEYBOARD_PLUGIN (plugin)->priv->manager, &error);
|
|
7 |
if (! res) {
|
14905
|
8 |
+ if (error != NULL) {
|
14808
|
9 |
g_warning ("Unable to start a11y_keyboard manager: %s", error->message);
|
|
10 |
g_error_free (error);
|
14905
|
11 |
+ } else {
|
14808
|
12 |
+ g_warning ("Unable to start a11y_keyboard manager.");
|
|
13 |
+ }
|
|
14 |
}
|
|
15 |
}
|
|
16 |
|
14905
|
17 |
/jds/bin/diff -uprN gnome-settings-daemon-2.25.3.old/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c gnome-settings-daemon-2.25.3/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
|
|
18 |
--- gnome-settings-daemon-2.25.3.old/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c 2009-01-13 15:26:10.509436000 +0000
|
|
19 |
+++ gnome-settings-daemon-2.25.3/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c 2009-01-13 15:33:22.384687000 +0000
|
|
20 |
@@ -655,7 +655,8 @@ ax_slowkeys_warning_post (GsdA11yKeyboar
|
13199
|
21 |
|
|
22 |
static gboolean
|
|
23 |
ax_stickykeys_warning_post_bubble (GsdA11yKeyboardManager *manager,
|
|
24 |
- gboolean enabled)
|
|
25 |
+ gboolean enabled,
|
|
26 |
+ gboolean key_pressed)
|
|
27 |
{
|
|
28 |
#ifdef HAVE_LIBNOTIFY
|
|
29 |
gboolean res;
|
14905
|
30 |
@@ -666,11 +667,17 @@ ax_stickykeys_warning_post_bubble (GsdA1
|
13199
|
31 |
title = enabled ?
|
|
32 |
_("Do you want to activate Sticky Keys?") :
|
|
33 |
_("Do you want to deactivate Sticky Keys?");
|
|
34 |
- message = enabled ?
|
|
35 |
- _("You just pressed the Shift key 5 times in a row. This is the shortcut "
|
|
36 |
- "for the Sticky Keys feature, which affects the way your keyboard works.") :
|
|
37 |
- _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
|
|
38 |
- "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
|
14905
|
39 |
+
|
13199
|
40 |
+ if (enabled) {
|
|
41 |
+ message = _("You just pressed the Shift key 5 times in a row. This is the shortcut "
|
|
42 |
+ "for the Sticky Keys feature, which affects the way your keyboard works.");
|
|
43 |
+ } else if (key_pressed) {
|
|
44 |
+ message = _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
|
|
45 |
+ "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
|
|
46 |
+ } else {
|
|
47 |
+ message = _("Sticky Keys have not been used for a while. This inactivity turns off "
|
|
48 |
+ "the Sticky Keys feature, which affects the way your keyboard works.");
|
|
49 |
+ }
|
|
50 |
|
14808
|
51 |
if (manager->priv->status_icon == NULL || ! gtk_status_icon_is_embedded (manager->priv->status_icon)) {
|
13199
|
52 |
return FALSE;
|
14905
|
53 |
@@ -731,7 +738,8 @@ ax_stickykeys_warning_post_bubble (GsdA1
|
11506
|
54 |
|
|
55 |
static void
|
13199
|
56 |
ax_stickykeys_warning_post_dialog (GsdA11yKeyboardManager *manager,
|
11506
|
57 |
- gboolean enabled)
|
|
58 |
+ gboolean enabled,
|
|
59 |
+ gboolean key_pressed)
|
|
60 |
{
|
13199
|
61 |
const char *title;
|
|
62 |
const char *message;
|
14905
|
63 |
@@ -739,11 +747,17 @@ ax_stickykeys_warning_post_dialog (GsdA1
|
13199
|
64 |
title = enabled ?
|
|
65 |
_("Do you want to activate Sticky Keys?") :
|
|
66 |
_("Do you want to deactivate Sticky Keys?");
|
|
67 |
- message = enabled ?
|
|
68 |
- _("You just pressed the Shift key 5 times in a row. This is the shortcut "
|
|
69 |
- "for the Sticky Keys feature, which affects the way your keyboard works.") :
|
|
70 |
- _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
|
|
71 |
- "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
|
14905
|
72 |
+
|
13199
|
73 |
+ if (enabled) {
|
|
74 |
+ message = _("You just pressed the Shift key 5 times in a row. This is the shortcut "
|
|
75 |
+ "for the Sticky Keys feature, which affects the way your keyboard works.");
|
|
76 |
+ } else if (key_pressed) {
|
|
77 |
+ message = _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
|
|
78 |
+ "This turns off the Sticky Keys feature, which affects the way your keyboard works.");
|
|
79 |
+ } else {
|
|
80 |
+ message = _("Sticky Keys have not been used for a while. This inactivity turns off "
|
|
81 |
+ "the Sticky Keys feature, which affects the way your keyboard works.");
|
|
82 |
+ }
|
11506
|
83 |
|
|
84 |
if (manager->priv->stickykeys_alert != NULL) {
|
|
85 |
gtk_widget_show (manager->priv->stickykeys_alert);
|
14905
|
86 |
@@ -788,19 +802,21 @@ ax_stickykeys_warning_post_dialog (GsdA1
|
13199
|
87 |
|
|
88 |
static void
|
|
89 |
ax_stickykeys_warning_post (GsdA11yKeyboardManager *manager,
|
|
90 |
- gboolean enabled)
|
|
91 |
+ gboolean enabled,
|
|
92 |
+ gboolean key_pressed)
|
|
93 |
{
|
11506
|
94 |
|
13199
|
95 |
manager->priv->stickykeys_shortcut_val = enabled;
|
|
96 |
|
|
97 |
/* alway try to show something */
|
|
98 |
- if (! ax_stickykeys_warning_post_bubble (manager, enabled)) {
|
|
99 |
- ax_stickykeys_warning_post_dialog (manager, enabled);
|
|
100 |
+ if (! ax_stickykeys_warning_post_bubble (manager, enabled, key_pressed)) {
|
|
101 |
+ ax_stickykeys_warning_post_dialog (manager, enabled, key_pressed);
|
|
102 |
}
|
11506
|
103 |
}
|
|
104 |
|
|
105 |
static void
|
|
106 |
-set_gconf_from_server (GsdA11yKeyboardManager *manager)
|
13199
|
107 |
+set_gconf_from_server (GsdA11yKeyboardManager *manager,
|
|
108 |
+ gboolean key_pressed)
|
11506
|
109 |
{
|
|
110 |
GConfClient *client;
|
|
111 |
GConfChangeSet *cs;
|
14905
|
112 |
@@ -927,7 +943,7 @@ set_gconf_from_server (GsdA11yKeyboardMa
|
13199
|
113 |
desc->ctrls->enabled_ctrls & XkbSlowKeysMask);
|
11506
|
114 |
} else {
|
13199
|
115 |
ax_stickykeys_warning_post (manager,
|
|
116 |
- desc->ctrls->enabled_ctrls & XkbStickyKeysMask);
|
|
117 |
+ desc->ctrls->enabled_ctrls & XkbStickyKeysMask, key_pressed);
|
11506
|
118 |
}
|
|
119 |
}
|
|
120 |
}
|
14905
|
121 |
@@ -952,11 +968,12 @@ cb_xkb_event_filter (GdkXEvent
|
11506
|
122 |
{
|
|
123 |
XEvent *xev = (XEvent *) xevent;
|
|
124 |
XkbEvent *xkbEv = (XkbEvent *) xevent;
|
|
125 |
+ static gboolean key_pressed = FALSE;
|
|
126 |
|
|
127 |
if (xev->xany.type == (manager->priv->xkbEventBase + XkbEventCode) &&
|
|
128 |
xkbEv->any.xkb_type == XkbControlsNotify) {
|
12548
|
129 |
d ("XKB state changed");
|
11506
|
130 |
- set_gconf_from_server (manager);
|
13199
|
131 |
+ set_gconf_from_server (manager, key_pressed);
|
11506
|
132 |
} else if (xev->xany.type == (manager->priv->xkbEventBase + XkbEventCode) &&
|
|
133 |
xkbEv->any.xkb_type == XkbAccessXNotify) {
|
|
134 |
if (xkbEv->accessx.detail == XkbAXN_AXKWarning) {
|
14905
|
135 |
@@ -967,6 +984,9 @@ cb_xkb_event_filter (GdkXEvent
|
13199
|
136 |
* set_gconf_from_server().
|
11506
|
137 |
*/
|
|
138 |
}
|
13199
|
139 |
+ } else if (xev->xany.type == (manager->priv->xkbEventBase + XkbEventCode) &&
|
|
140 |
+ xkbEv->any.xkb_type == XkbStateNotify) {
|
|
141 |
+ key_pressed = TRUE;
|
11506
|
142 |
}
|
|
143 |
|
|
144 |
return GDK_FILTER_CONTINUE;
|
14905
|
145 |
@@ -1017,7 +1037,7 @@ start_a11y_keyboard_idle_cb (GsdA11yKeyb
|
|
146 |
*/
|
|
147 |
manager->priv->original_xkb_desc = get_xkb_desc_rec (manager);
|
11506
|
148 |
|
|
149 |
- event_mask = XkbControlsNotifyMask;
|
|
150 |
+ event_mask = XkbControlsNotifyMask | XkbStateNotifyMask;
|
|
151 |
#ifdef DEBUG_ACCESSIBILITY
|
|
152 |
event_mask |= XkbAccessXNotifyMask; /* make default when AXN_AXKWarning works */
|
|
153 |
#endif
|