After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 559558 - [a11y-keyboard] init status icon only when needed
[a11y-keyboard] init status icon only when needed
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2008-11-06 06:20 UTC by Behdad Esfahbod
Modified: 2008-11-06 19:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (5.51 KB, patch)
2008-11-06 18:18 UTC, Behdad Esfahbod
none Details | Review
updated patch (5.28 KB, patch)
2008-11-06 19:19 UTC, Behdad Esfahbod
committed Details | Review

Description Behdad Esfahbod 2008-11-06 06:20:02 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.
Comment 1 Jens Granseuer 2008-11-06 17:38:38 UTC
(In reply to comment #0)
> Attaching patch.

Really?
Comment 2 Behdad Esfahbod 2008-11-06 18:18:56 UTC
Created attachment 122134 [details] [review]
the patch
Comment 3 Behdad Esfahbod 2008-11-06 18:21:14 UTC
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);
Comment 4 Behdad Esfahbod 2008-11-06 18:23:34 UTC
Oops, ignore comment #3.  Was meant for another bug.
Comment 5 Jens Granseuer 2008-11-06 18:35:38 UTC
-        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.
Comment 6 Behdad Esfahbod 2008-11-06 18:58:56 UTC
Good point.
Comment 7 Behdad Esfahbod 2008-11-06 19:19:09 UTC
Created attachment 122146 [details] [review]
updated patch
Comment 8 Behdad Esfahbod 2008-11-06 19:45:30 UTC
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)