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 610544 - The keyboard layout icon is empty
The keyboard layout icon is empty
Status: RESOLVED NOTGNOME
Product: gnome-settings-daemon
Classification: Core
Component: general
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-20 16:11 UTC by Thanos Lefteris
Modified: 2010-03-07 16:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Layouts in russian (302.57 KB, image/png)
2010-02-24 17:00 UTC, Thanos Lefteris
Details

Description Thanos Lefteris 2010-02-20 16:11:10 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.
Comment 1 Jens Granseuer 2010-02-20 16:57:44 UTC
I'd be genuinely suprised if our resident Russian didn't take that into account... Calling Sergey...
Comment 2 Sergey V. Udaltsov 2010-02-21 00:25:20 UTC
That is really odd. I will double-check that. Thanks for reporting!
Comment 3 Sergey V. Udaltsov 2010-02-21 22:25:43 UTC
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)
Comment 4 Thanos Lefteris 2010-02-24 17:00:37 UTC
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.
Comment 5 Thanos Lefteris 2010-02-24 18:18:51 UTC
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?
Comment 6 Sergey V. Udaltsov 2010-02-25 19:41:28 UTC
It seems you're right. There is something special about latam layout. Going to check. Thanks!
Comment 7 Sergey V. Udaltsov 2010-02-25 19:52:48 UTC
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 (ЛАм)
Comment 8 Alkis Georgopoulos 2010-02-25 20:24:20 UTC
Thank you Sergey, much appreciated. How can we be notified when a fix is committed in xkeyboard-config?
Comment 9 Sergey V. Udaltsov 2010-02-26 17:17:46 UTC
I sync translations before every release. That makes it ... May. But distros are free to patch themselves. It is pretty obvious fix.
Comment 10 Alkis Georgopoulos 2010-02-26 17:27:56 UTC
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
Comment 11 Sergey V. Udaltsov 2010-02-26 17:39:13 UTC
Ok, that must be another scenario. I will check.
Comment 12 Sergey V. Udaltsov 2010-03-02 23:30:17 UTC
Reproducable. Going to check.
Comment 13 Sergey V. Udaltsov 2010-03-02 23:39:36 UTC
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.
Comment 14 Sergey V. Udaltsov 2010-03-02 23:52:05 UTC
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.
Comment 15 Alkis Georgopoulos 2010-03-03 06:32:16 UTC
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. :)
Comment 16 Sergey V. Udaltsov 2010-03-03 18:21:25 UTC
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
Comment 17 Alkis Georgopoulos 2010-03-06 12:02:18 UTC
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
Comment 18 Sergey V. Udaltsov 2010-03-07 16:27:07 UTC
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