Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore some keymaps #224

Merged
merged 2 commits into from Aug 16, 2019

Conversation

@dgdavid
Copy link
Member

commented Aug 14, 2019

Problem

After the keymaps fixes, the arabic and khmer keymaps stop working in X11.

Why?

Since

Although actually they are only symlinks to us.map.gz, are still being
needed because the yast2-x11 is using them to obtain the proper
"XkbLayout".

Click to show/hide a _rather long_ explanation

Information extracted from https://trello.com/c/y5fA3MK2

While looking for a keyboard layout for Farsi language, I found that we could have a problem with the latest changes introduced by @ancorgs when unifying the keyboard_raw.ycp and keyboard_raw_opensuse.ycp files.

The arabic.map.gz and khmer.map.gz were changed into us.map.gz since former are simply links to the latest. However, the change has a not desired/expected side effect: the keyboard layout isn't being changed properly in X11. Why? Because of yast2-x11, more exactly the xkbctrl tool, which is being used by the keyboard module to "get the keyboard info for X11" based on the given keymap.

As could be seen following the links above, it will end executing

/usr/sbin/xkbctrl

which will produce different outputs for arabic.map.gz, khmer.map.gz, and us.map.gz. See below.

❯ /usr/sbin/xkbctrl arabic.map.gz
$[
   "XkbLayout"    : "ara,us",
   "XkbModel"     : "pc105",
   "XkbOptions"   : "terminate:ctrl_alt_bksp,grp:shift_toggle",
   "Apply"        : "-layout ara,us -model pc105 -option terminate:ctrl_alt_bksp,grp:shift_toggle"
]
❯ /usr/sbin/xkbctrl khmer.map.gz
$[
   "XkbLayout"    : "kh,us",
   "XkbModel"     : "pc105",
   "XkbOptions"   : "terminate:ctrl_alt_bksp",
   "Apply"        : "-layout kh,us -model pc105 -option terminate:ctrl_alt_bksp"
]
❯ /usr/sbin/xkbctrl us.map.gz
$[
   "XkbLayout"    : "us",
   "XkbModel"     : "microsoftpro",
   "XkbOptions"   : "terminate:ctrl_alt_bksp",
   "Apply"        : "-layout us -model microsoftpro -option terminate:ctrl_alt_bksp"
]

Then, the value of Apply part is being used at

@xkb_cmd = "#{File.join(XVersion.binPath, "setxkbmap")} #{@Apply}"

setxkbmap -layout ara,us -model pc105 -option terminate:ctrl_alt_bksp,grp:shift_toggle

and the rest of data in write_udev_rule, which seems to set the X11 keyboard during the installation

I did a handful of tests and I can confirm that the "original" behavior is broken in both, SLE and openSUSE, when using Gnome Classic/X11, but not in Gnome Wayland, where the keyboard layout never changes .

Solution

Restore the arabic.map.gz and khmer.map.gz keymaps.

Tests

  • Tested manually via dud.

Screenshots

Click to show/hide some screenshots

Screenshot_sle15sp2_2019-08-14_16:52:37

During installation


Screenshot_sle15sp2_2019-08-16_07:46:01

In an installed system


Related to #218

@dgdavid dgdavid requested a review from ancorgs Aug 14, 2019

@coveralls

This comment has been minimized.

Copy link

commented Aug 14, 2019

Coverage Status

Coverage remained the same at 21.32% when pulling b9cadd5 on restore_some_keymaps into 46d63cf on master.

@dgdavid dgdavid marked this pull request as ready for review Aug 16, 2019

dgdavid and others added 2 commits Aug 14, 2019
Restore arabic and hkmer keyboard maps
Although actually they are only sym links to us.map.gz, are still being
needed because the yast2-x11 is using them to obtain the proper
"XkbLayout".

Co-authored-by: Ancor Gonzalez Sosa <ancor@suse.de>

@dgdavid dgdavid force-pushed the restore_some_keymaps branch from 897298c to b9cadd5 Aug 16, 2019

@ancorgs
Copy link
Contributor

left a comment

LGTM

@dgdavid dgdavid merged commit 3131ec0 into master Aug 16, 2019

4 checks passed

Docker Build Task Summary
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 21.32%
Details

@dgdavid dgdavid deleted the restore_some_keymaps branch Aug 16, 2019

@yast-bot

This comment has been minimized.

Copy link

commented Aug 16, 2019

✔️ Public Jenkins job #30 successfully finished
✔️ Created OBS submit request #724120

@yast-bot

This comment has been minimized.

Copy link

commented Aug 16, 2019

✔️ Internal Jenkins job #7 successfully finished
✔️ Created IBS submit request #199078

@joseivanlopez joseivanlopez referenced this pull request Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.