GNOME Bugzilla – Bug 559558
[a11y-keyboard] init status icon only when needed
Last modified: 2008-11-06 19:45:30 UTC
Delay creating status_icon until needed. Currently gsd_a11y_keyboard_manager_init looks up status_icon, causing the gtk+ theme to be searched and loaded, even if the icon is never used. Attaching patch.
(In reply to comment #0) > Attaching patch. Really?
Created attachment 122134 [details] [review] the patch
Speaking of XSync, I also have this in my bag: From 94bdd9924789f12d4cd4e1516e9462b8c033bd59 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod <behdad@behdad.org> Date: Thu, 6 Nov 2008 02:38:42 -0500 Subject: [PATCH] [a11y-keyboard] Remove XSync after XkbGetMap The man page for XkbGetMap says it's synchronous already. --- plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c index 5c9c6e5..9b37e87 100644 --- a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c +++ b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c @@ -128,7 +128,6 @@ get_xkb_desc_rec (GsdA11yKeyboardManager *manager) desc->ctrls = NULL; status = XkbGetControls (GDK_DISPLAY (), XkbAllControlsMask, desc); } - XSync (GDK_DISPLAY (), FALSE); gdk_error_trap_pop (); g_return_val_if_fail (desc != NULL, NULL);
Oops, ignore comment #3. Was meant for another bug.
- gtk_status_icon_set_visible (manager->priv->status_icon, show); + if (show) { + gsd_a11y_keyboard_manager_ensure_status_icon (manager); + gtk_status_icon_set_visible (manager->priv->status_icon, show); + } This looks wrong. We also need to hide the icon again when the feature gets disabled.
Good point.
Created attachment 122146 [details] [review] updated patch
2008-11-06 Behdad Esfahbod <behdad@gnome.org> * plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c (maybe_show_status_icon), (ax_slowkeys_warning_post_bubble), (ax_stickykeys_warning_post_bubble), (gsd_a11y_keyboard_manager_stop), (gsd_a11y_keyboard_manager_ensure_status_icon), (gsd_a11y_keyboard_manager_init): Init status icon only when needed (bug #559558)