Bug 1011155 - wrong title of the keyboard preview dialog for some layouts
wrong title of the keyboard preview dialog for some layouts
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity low
: rc
: ---
Assigned To: David Shea
Release Test Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-23 13:00 EDT by Tomas Capek
Modified: 2014-06-17 21:38 EDT (History)
5 users (show)

See Also:
Fixed In Version: anaconda-19.31.31-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 06:30:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Gkbd preview dialog in the installer (58.38 KB, image/png)
2013-09-27 13:13 EDT, Vratislav Podzimek
no flags Details

  None (edit)
Description Tomas Capek 2013-09-23 13:00:19 EDT
Description of problem:

For some keyboard layouts, the title of the keyboard preview dialog is "?" rather than the name of the layout.

I've observed that "normal" layouts such as "English (English (US))", "German (German)", or "Armenian (Armenian)" are not affected.

But "special" layouts such as "English (English (Colemak))", "German (German (Dvorak))", or "Armenian (Armenian (phonetic))" have the title reset to "?".
Comment 2 Vratislav Podzimek 2013-09-24 15:14:25 EDT
We just use the following code making use of the libgnomkbd:

dialog = Gkbd.KeyboardDrawing.dialog_new()
Gkbd.KeyboardDrawing.dialog_set_layout(dialog, self._xkl_wrapper.configreg,
                                               layout_row[0])

where layout_row[0] is layout + variant (e.g. 'cz' or 'cz (qwerty)'). Reassigning to libgnomekbd.
Comment 3 Rui Matos 2013-09-27 10:49:33 EDT
(In reply to Vratislav Podzimek from comment #2)
> We just use the following code making use of the libgnomkbd:
> 
> dialog = Gkbd.KeyboardDrawing.dialog_new()
> Gkbd.KeyboardDrawing.dialog_set_layout(dialog, self._xkl_wrapper.configreg,
>                                                layout_row[0])
> 
> where layout_row[0] is layout + variant (e.g. 'cz' or 'cz (qwerty)').

You need to build that string like:

>>> layout = 'cz'
>>> variant = 'qwerty'
>>> str = layout + '\t' + variant
Comment 4 Vratislav Podzimek 2013-09-27 11:33:20 EDT
(In reply to Rui Matos from comment #3)
> (In reply to Vratislav Podzimek from comment #2)
> > We just use the following code making use of the libgnomkbd:
> > 
> > dialog = Gkbd.KeyboardDrawing.dialog_new()
> > Gkbd.KeyboardDrawing.dialog_set_layout(dialog, self._xkl_wrapper.configreg,
> >                                                layout_row[0])
> > 
> > where layout_row[0] is layout + variant (e.g. 'cz' or 'cz (qwerty)').
> 
> You need to build that string like:
> 
> >>> layout = 'cz'
> >>> variant = 'qwerty'
> >>> str = layout + '\t' + variant
I can fix that, but isn't the problem on Gkbd's side? If it understands the argument and shows the right layout, it should set the right title as well.
Comment 5 Rui Matos 2013-09-27 11:36:32 EDT
(In reply to Vratislav Podzimek from comment #4)
> I can fix that, but isn't the problem on Gkbd's side? If it understands the
> argument and shows the right layout, it should set the right title as well.

But it doesn't understand it. You can consider this to be the "API".
Comment 6 Vratislav Podzimek 2013-09-27 13:13:03 EDT
(In reply to Rui Matos from comment #5)
> (In reply to Vratislav Podzimek from comment #4)
> > I can fix that, but isn't the problem on Gkbd's side? If it understands the
> > argument and shows the right layout, it should set the right title as well.
> 
> But it doesn't understand it. You can consider this to be the "API".
Well, it shows the right characters in the preview, just the title is wrong.
Comment 7 Vratislav Podzimek 2013-09-27 13:13:43 EDT
Created attachment 804065 [details]
Gkbd preview dialog in the installer
Comment 8 Rui Matos 2013-09-28 07:27:27 EDT
(In reply to Vratislav Podzimek from comment #6)
> (In reply to Rui Matos from comment #5)
> > But it doesn't understand it. You can consider this to be the "API".
> Well, it shows the right characters in the preview, just the title is wrong.

Right, sorry, it's more nuanced than just "it doesn't understand it".

The part of the code that gets the geometry data does understand "cz(qwerty)". This part actually calls into the X server and the X server apparently can handle this.

But, the X server doesn't tell you the actual name (i.e. "Czech (qwerty)"). To get this string libgnomekbd calls into libxklavier which then parses /usr/share/X11/xkb/rules/evdev.xml. It's this part of the code that only understands the format "layout\tvariant".

In any case, please use the \t format since I'd rather avoid patching these libraries which are increasingly becoming obsolete.
Comment 11 David Shea 2013-10-28 15:26:19 EDT
Broken again, but now it seems to be all layouts.
Comment 12 David Shea 2013-10-28 16:14:31 EDT
Actually, it's not all layouts, just the ones with no variant string (e.g., "us").
Comment 13 Michal Kovarik 2014-02-05 09:03:31 EST
Verified on RHEL-7.0-20140127.0 with anaconda-19.31.51-1.el7. All mentioned layout ("English (English (Colemak))", "German (German (Dvorak))", or "Armenian (Armenian (phonetic))") have proper title.
Comment 14 Ludek Smid 2014-06-13 06:30:45 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.