From 327afa27307143f1827dd0dcf2d99360f1b1a3a4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 5 Apr 2011 11:10:53 -0400 Subject: [PATCH] Fix keyboard indicator size --- 0001-Status-icon-fix-size-problems.patch | 46 ++++++++++++++++++++++++ libgnomekbd.spec | 9 +++-- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 0001-Status-icon-fix-size-problems.patch diff --git a/0001-Status-icon-fix-size-problems.patch b/0001-Status-icon-fix-size-problems.patch new file mode 100644 index 0000000..87503c9 --- /dev/null +++ b/0001-Status-icon-fix-size-problems.patch @@ -0,0 +1,46 @@ +From b922ecd4777d80524e91644c98c46f6ed3577f1f Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Tue, 5 Apr 2011 11:06:13 -0400 +Subject: [PATCH] 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 +--- + libgnomekbd/gkbd-status.c | 11 +++++++++++ + 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; +-- +1.7.4.2 + diff --git a/libgnomekbd.spec b/libgnomekbd.spec index c4f6f7c..3e52518 100644 --- a/libgnomekbd.spec +++ b/libgnomekbd.spec @@ -1,6 +1,6 @@ Name: libgnomekbd Version: 3.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A keyboard configuration library Group: System Environment/Libraries @@ -11,6 +11,7 @@ Source0: http://download.gnome.org/sources/libgnomekbd/3.0/libgnomekbd-%{ # https://bugzilla.gnome.org/show_bug.cgi?id=642703 Patch0: libgnomekbd-colors.patch +Patch1: 0001-Status-icon-fix-size-problems.patch BuildRequires: gtk3-devel >= 3.0.0 BuildRequires: cairo-devel @@ -54,7 +55,8 @@ of the keyboard indicator applet. %prep %setup -q -%patch0 -p1 -b colors +%patch0 -p1 -b .colors +%patch1 -p1 -b .size %build %configure --disable-static \ @@ -126,6 +128,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : %changelog +* Tue Apr 5 2011 Matthias Clasen - 3.0.0-2 +- Fix size of keyboard indicator in fallback mode + * Mon Apr 4 2011 Matthias Clasen - 3.0.0-1 - Update to 3.0.0