Bug 1011155

Summary: wrong title of the keyboard preview dialog for some layouts
Product: Red Hat Enterprise Linux 7 Reporter: Tomas Capek <tcapek>
Component: anacondaAssignee: David Shea <dshea>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.0CC: dshea, mbanas, mkovarik, rmatos, vpodzime
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: anaconda-19.31.31-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:30:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Gkbd preview dialog in the installer none

Description Tomas Capek 2013-09-23 17:00:19 UTC
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 19:14:25 UTC
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 14:49:33 UTC
(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 15:33:20 UTC
(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 15:36:32 UTC
(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 17:13:03 UTC
(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 17:13:43 UTC
Created attachment 804065 [details]
Gkbd preview dialog in the installer

Comment 8 Rui Matos 2013-09-28 11:27:27 UTC
(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 19:26:19 UTC
Broken again, but now it seems to be all layouts.

Comment 12 David Shea 2013-10-28 20:14:31 UTC
Actually, it's not all layouts, just the ones with no variant string (e.g., "us").

Comment 13 Michal Kovarik 2014-02-05 14:03:31 UTC
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 10:30:45 UTC
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.