GNOME Bugzilla – Bug 610544
The keyboard layout icon is empty
Last modified: 2010-03-07 16:27:07 UTC
This bug has been reported here: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/524136 $ killall gnome-settings-daemon $ LANG=en_US.UTF-8 gnome-settings-daemon Result (OK): I see the new status icon, with [USA] and [Gre] as the images. $ killall gnome-settings-daemon $ LANG=el_GR.UTF-8 gnome-settings-daemon Result (not OK): The status icon is now empty. If I hover my mouse over it, I can see the expected names as tooltips: [ΗΠΑ] and [Ελλάδα]. So I'm guessing that the code that draws the language strings on the status icon is not utf-8 aware.
I'd be genuinely suprised if our resident Russian didn't take that into account... Calling Sergey...
That is really odd. I will double-check that. Thanks for reporting!
Just checked. I do not have that locale, but with ru_RU.UTF-8 it is ok. I had to set LANG, LANGUAGE and GDM_LANG env vars. Could anybody else please check? Also, in libgnomekbd there is test/gkbd-status-test app, it might be worth checking as well (with g-s-d killed)
Created attachment 154610 [details] Layouts in russian I tested using a russian enviroment and loading various keyboard layouts. It seams that if the layout code contains latic set characters, it displays fine. But if it contains any other characters, the code doesn't display at all. In the screenshot attached the first two layouts (should be greek and english) display fine. The third layout (I don't know what it is as I can't read russian, I picked it in random) doesn't display the code in the status, as you can see.
Sorry, it's actually this particular 3rd layout in the screenshot, that doesn't display. I haven't managed yet to find another one causing the problem using the russian environment. But most of them don't display for Greek. Also forget what I said above about the character sets. I haven't found a pattern about what causes the problem in some layouts. If you need any info for debugging I'm here. Sergey how am I supposed to run this test app?
It seems you're right. There is something special about latam layout. Going to check. Thanks!
The short description cannot be longer than 10 BYTES (not characters), including NULL. The translation "ЛатАм" takes 11 bytes. As the result, the last character (м) got truncated, the whole string becomes invalid UTF-8 - and cannot be rendered. Going to sort it in xkeyboard-config. Locally, you can change po/ru.po (in xk-c), find that string and make it shorter (ЛАм)
Thank you Sergey, much appreciated. How can we be notified when a fix is committed in xkeyboard-config?
I sync translations before every release. That makes it ... May. But distros are free to patch themselves. It is pretty obvious fix.
Sorry I meant the code fix, that wouldn't produce invalid utf-8 sequences, not the translations fix. But I was also wondering about the following: echo ΗΠΑ | hexdump 0000000 97ce a0ce 91ce 000a So ΗΠΑ (=the US layout in Greek) needs 7 characters along with the NULL character. Why isn't that displayed at all? And, why is "Λατινική Αμερική" displayed as "μ"; Maybe there's another problem, except for the 10 bytes limitation? Thank you, Alkis
Ok, that must be another scenario. I will check.
Reproducable. Going to check.
The default font 'Helvetica' (used for the labels) seems not to have Greek chars. Edit the gconf entry '/desktop/gnome/peripherals/keyboard/indicator/fontFamily', change it to Arial (if you have that font installed) or just clear it. That should show the label (perhaps you'd need to restart gnome-settings-daemon). I will think of the "right" value. Actually, any hint about getting the default font name (usable in Cairo) from gtk would be appreciated.
For a moment, changed to Sans (works ok with Greek and Russian). But it looks a bit off IMHO... Too much antialiazing? If anybody knows how to improve - please share your ideas.
Changing the font indeed makes the text visible. For a more consistent result, would it be possible to use the same text rendering logic that the menus and the clock applet have? (maybe the applet width would need to be determined in the runtime in this case). In any case now it's workable, so thanks a lot Sergey. :)
I could not find the way to determine the font used by menus. If you know how to do that, please let me know. The width is determined at runtime IIRC
I meant, instead of using cairo and trying to determine the font name, size, and have a lot of gconf keys to configure all that, and having hooks to change the look whenever the theme changes, to use a simple gtk_label like the clock applet does, which would take care of everything automatically. See the function create_main_clock_label in clock.c of gnome-panel, it just uses gtk_label_new... Regards, Alkis
The indicator is not an applet any more. And using gtk widgets is problematic. Anyway, this is fixed now - I am using the font name/size/colour from gnome, unless overridden by local indicator settings