summaryrefslogtreecommitdiff
path: root/libgnomekbd
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-04-05 11:06:13 -0400
committerSergey V. Udaltsov <svu@gnome.org>2011-04-05 21:12:27 +0100
commit102cdfac6df7a021ff866192e77e8f97f56ce5a4 (patch)
treec0c093edbdcc3f82abf0e8cdb1f1258e4fa57286 /libgnomekbd
parentab411c5084e1816df56f97351132329aeb4123be (diff)
downloadlibgnomekbd-102cdfac6df7a021ff866192e77e8f97f56ce5a4.tar.gz
Status icon: fix size problems
There are bugs in both the notification area and in GtkStatusIcon when it comes to size allocation. This patch tries to work around them in a way that makes the keyboard indicator come up with a reasonable size initially, and not resize when clicked. https://bugzilla.gnome.org/show_bug.cgi?id=642703
Diffstat (limited to 'libgnomekbd')
-rw-r--r--libgnomekbd/gkbd-status.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libgnomekbd/gkbd-status.c b/libgnomekbd/gkbd-status.c
index 276fe54..2f5b41f 100644
--- a/libgnomekbd/gkbd-status.c
+++ b/libgnomekbd/gkbd-status.c
@@ -393,6 +393,12 @@ void
gkbd_status_reinit_ui (GkbdStatus * gki)
{
gkbd_status_set_current_page (gki);
+ /* To work around combined bugs in notification-area
+ * and GtkStatusIcon, reshow the icon here, to ensure
+ * size changes are picked up.
+ */
+ gtk_status_icon_set_visible (GTK_STATUS_ICON (gki), FALSE);
+ gtk_status_icon_set_visible (GTK_STATUS_ICON (gki), TRUE);
}
/* Should be called once for all widgets */
@@ -509,6 +515,11 @@ static void
gkbd_status_size_changed (GkbdStatus * gki, gint size)
{
xkl_debug (150, "Size changed to %d\n", size);
+ /* Ignore the initial size 200 that we get before
+ * we are embedded
+ */
+ if (!gtk_status_icon_is_embedded (GTK_STATUS_ICON (gki)))
+ return;
if (globals.current_height != size) {
globals.current_height = size;
globals.current_width = size * 3 / 2;