Keyboard layout change on hotkeys press instead of release and do not work well with shortcuts (reopen)

Bug #1683383 reported by Lastique on 2017-04-17
406
This bug affects 74 people
Affects Status Importance Assigned to Milestone
X.Org X server
Confirmed
High
xorg (Debian)
New
Unknown
xorg-server (Ubuntu)
Wishlist
Alex

Bug Description

From duplicate bug 1720364 report.

Steps to reproduce:
1. Install ubuntu-mate-desktop on Ubuntu 16.04 LTS with HWE (Xorg 1.19.5), or 17.10 or 18.04 LTS.
2. Set-up two keyboard layouts - English and Russian
3. Set <Ctrl+Shift> as keyboard layout switcher in mate-control-center
4. Try to use shortcuts starting from <Ctrl+Shift>:
4.1. Open Firefox, open new tab, go to some site in it, close tab, try to click <Ctrl+Shift+T> to restore closed tab.
4.2. Open mate-terminal, try to open new tab with <Ctrl+Shift+T>, or copy (<Ctrl+Shift+C>), or paste (<Ctrl+Shift+V>).
4.3. Open pluma, write some text, try to navigate in it with <Ctrl+Shift+arrow>.

Expected results:
<Ctrl+Shift> switches keyboard layout, shortcuts starting from <Ctrl+Shift+...> work normally.

Actual results:
<Ctrl+Shift> switches keyboard layout, shortcuts starting from <Ctrl+Shift+...> do not work.

Notes:
1. Ubuntu 16.04 LTS (Xorg 1.18.4) with Marco and Compton work normally with <Ctrl+Shift> keyboard layout switcher.
2. This problem was discovered before on 13.10, 14.04 and other modern versions with GNOME desktop (Metacity and Compiz) - see bug 1245473.

---------------------------
Original description below:

This is a reopen of bug #36812, which has reappeared in Kubuntu 17.04 Zesty Zapus.

This is a bug about shortcuts mapped to combinations which include each other.

For example, if we have Ctrl+Shift (for keyboard layout) and Ctrl+Shift+N (to open a new terminal), then we are practically unable to use the second shortcut; this is what happens:
Ctrl press (nothing happens)
Shift press (keyboard layout change)
N (a simple N appears, since a shortcut has already fired)

The expected behavior is to fire shortcuts on the release (not on press) of the special keys (ctrl,shift,alt, etc) which is also how Windows behave. This is a serious problem for bilingual layouts, typically using Alt+Shift or Ctrl+Shift for keyboard layout change.

Apparently, the bug has reappeared after the patch that used to fix the problem (208_switch_on_release.diff) has been removed from X.Org 1.19 packages. There is an updated patch in the upstream ticket https://bugs.freedesktop.org/show_bug.cgi?id=865 (link to the attachment: https://bugs.freedesktop.org/attachment.cgi?id=129861).

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: xserver-xorg-core 2:1.19.3-1ubuntu1
Uname: Linux 4.9.0-22.1-liquorix-amd64 x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.4-0ubuntu4
Architecture: amd64
CurrentDesktop: KDE
Date: Mon Apr 17 17:46:35 2017
InstallationDate: Installed on 2015-05-01 (716 days ago)
InstallationMedia: Kubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: xorg-server
UpgradeStatus: Upgraded to zesty on 2017-04-16 (1 days ago)

Lastique (andysem) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg-server (Ubuntu):
status: New → Confirmed
Timo Aaltonen (tjaalton) wrote :

And if you had a look at the upstream bug you'd see that the patch doesn't work. It needs to get upstream first anyway.

Alex Ee (bibi4k0) wrote :

I had the same problem.

tlk (sarcasticskull) wrote :

Timo Aaltonen (tjaalton) wrote 10 hours ago: #3

And if you had a look at the upstream bug you'd see that the patch doesn't work. It needs to get upstream first anyway.
-------------------------------
1) It's just one (incomplete) report that it doesn't. I'll try the patch myself soon.
2) The previous patch wasn't in upstream either, yet Ubuntu maintainers did absolutely right to accept it IMO.
3) AFAIK Xorg people rejected this change outright (that is? after some prolonged explanaitons what the actual problem was - shows that they just don't have the issue thus don't care too much).
3) Yet people shouldn't be held hostage because the proposed behavior breaks the XKB spec - without (? AFAIK) a single confirmed case of it breaking any real world X client.

Lastique (andysem) wrote :

> And if you had a look at the upstream bug you'd see that the patch doesn't work.

I can see that someone reported it to not work for one-key combinations (e.g. Ctrl). I believe, the previous patch that was removed had the same limitation, and it was "good enough".

We need to see if it works for two-key combinations (e.g. Ctrl+Alt or Alt+Shift).

> It needs to get upstream first anyway.

It's unlikely to be accepted into XKb for the same reasons as the previous patch. This ticket is a request to add the patch to Ubuntu packages because this is a real problem that affects people.

MKorvin (guitarmaster-play) wrote :

Same problem, waiting for fix.

flux242 (flux242) wrote :

please apply the old patch. Let the 17.04 work as the 16.10. Screw the upstream because it could take ages for them to decide

tlk (sarcasticskull) wrote :

Thats the problem - the old patch doesn't work for the newer Xorg server.

AFAIU the upstream won't accept this anyway.
Thus it's the matter of testing the patch and getting it into Ubuntu. AFAIK Ubuntu was the only major distro that applied the old patch. Was yet another reason to use it.

MKorvin (guitarmaster-play) wrote :

I have arch linux installed on another PC and Xorg server from https://aur.archlinux.org/packages/xorg-server-bug865/ works fine for me. Sources of applied patch are attached, is it possible to get it from there?

ainur (ainureg) wrote :

I have it since yesterday, when i decided to update x-server packages

404 sudo apt-get install xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-libinput xserver-xorg-input-synaptics xserver-xorg-input-wacom xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-openchrome xserver-xorg-video-qxl xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident xserver-xorg-video-vesa xserver-xorg-video-vmware
  405 sudo apt-get install xserver-xorg-input-evdev

Andrey Vetlugin (antrew) wrote :

This annoying bug takes my linux user experience 15 years back to 2002. Is there a way to make Ubuntu great again? Are there any known workarounds for this bug?

Vavooon (vavooon) wrote :

Meanwhile I can suggest a partial workaround for the problem:
You can map layout switching to LEFT Ctrl+Shift and right keys will be available for using with shortcuts.

tlk (sarcasticskull) wrote :

Not exactly a bug, it's just how it works by default and that is what the xkb specs supposedly say. So this behavior dates way back certainly more that 15 yrs ))
And the fix was incorporated by Ubuntu only a couple of yrs ago certainly not in 2002 )))

The 'workaround' suggested above is what I use btw. And what have used on other distros.

kolya (mar-kolya) wrote :

That patch that fixes the problem has been applied in Ubuntu for way more than 'couple of years'

Unfortunately using right keys for modifiers doesn't work well with people who use 10 finger typing - they are used to press certain keys with certain fingers - to speed up their typing, and using wrong hand slows things down and leads to errors. Some modifier-heavy apps - like Emacs become very inconvenient if used with wrong modifier keys.

tlk (sarcasticskull) wrote :

well yeah more than a couple. I actually remember when I got fed up with this and went looking on the net what can be done and later found out that Ubuntu would accept the patch - I was on another distro then. just don't remember when exactly.

I do the 10 fingers typing but even if you don't it's annoying.

ainur (ainureg) wrote :

btw

here is solution
i can translate if anyone wants
https://habrahabr.ru/post/87408/

tlk (sarcasticskull) wrote :

сАлюшн пересобрать руками с патчем? хабра такая хабра.

Timo Aaltonen (tjaalton) on 2017-08-11
Changed in xorg-server (Ubuntu):
importance: Undecided → Wishlist
Changed in xorg-server:
importance: Unknown → High
status: Unknown → In Progress
Artem Kovalov (artemkovalov) wrote :

Пересобрать таки помогло) Аж выдохнул. Жаль, что мейнтейнеры ppa не обновляют оперативно билды для свежих релизов.

Anton Petrusevich (apetr) wrote :

Please return the patch back!

Igor Kostromin (elw00d) wrote :

manual patching recipe (thx Artem Kovalov) for Ubuntu 16.04.3

https://gist.github.com/elw00d/0826917118d58e81843e2d11bc6cf885

I uploaded deb to https://www.sendspace.com/file/av86cf

Pavel (spvkgn) wrote :

I uploaded xorg-server 1.19.3 packages for 17.04 with included patch from https://bugs.freedesktop.org/show_bug.cgi?id=865 to PPA ppa:spvkgn/xorg-patches

Jacob Becker (jabecker) wrote :

I uploaded xorg-server 1.19.3 packages for 16.04.3 i386 with included patch from https://bugs.freedesktop.org/show_bug.cgi?id=865 to https://drive.google.com/open?id=0B_avx7RnFL6Ub1hESFZLT21iaG8

Jacob Becker (jabecker) wrote :

Here's my script based on the gist mentioned on comment #21
https://github.com/plastikat/patch-xkb-layout-switch

It tries to be generic. It uses a separate configuration file for each platform, which means it is extensible. It is still apt-based, though.

Vitaliy (velnik) wrote :

I had the same problem.
Ubuntu Mate 16.04.3 LTS

A (zorn-v) wrote :

My script based on Jacob's one.
https://gist.github.com/zorn-v/df0dccd14af81e017fbe8a4e1523ddf5

It removes all packages installed for build (with prompt).
Patch downdload commented out.

Bolow this line is the cry of the soul
====================================
It is IDIOTISM. It's need to recompile WHOLE X.ORG for simple behavior whose should be in some config at least.

Many dislikes and curse to upstream mainteiners. AFAIK this bug since 200X. THIS IS SHAME.

You can put your important opinion in the...
Yes, I don't respect you as you don't respect users (and distro mainteiners) of your lib.

A (zorn-v) wrote :

Also works on 17.10 BTW.

A (zorn-v) wrote :

Now I understand why "libs" like wayland appears. X.org SUCKS.

181 comments hidden view all 250 comments

Me too very upset about this bug: there is patch for several yers - no one cares. I suggest compromise: add autotools|meson option to enable this feature. At least every distro would be able to decide whether they want to provide nonstandard behavior.

I also see that this bug is assigned but nothing happens.

Why don't you change your layout switcher key-combination? You can set up another key-combinations for russian and different key-combination for english keyboard,too. That's KDE's problem, that allow choose frequently used key combinations.

With all due respect, I hope this is not the usual response to X bugs. I do not think it is unreasonable to ask that shortcuts be made available from the set of control keys, since this is a very widespread feature across operating systems. I have used Kubuntu for the past several years, and made use of the alt-shift key combination to toggle between the English and Greek keyboard layouts. After the recent KDE change I find this bug affecting my workflow, interrupting various keyboard combinations involving the use of those modifiers. I think it is appropriate to call this a bug in xkb's behaviour.

I wholeheartedly understand that X developers are more thinly stretched than most, and that this bug—despite its labeled importance—does not have as extreme a disruptive impact as many other bugs. I have no desire to complain of the amount of time this bug has spent open and demand that it be fixed. I would however request that this bug not be closed, as it is indeed a bug and the responsibility of xkb.

The main keyword the KDE interface programming philosophy called Quick Time. Windows use message queue, and uses built togheter windows manager with the os hardly. Qt enables for programs override every reactions, "answered" the user actions. Under xcfe desktop manager main program override subprograms actions, for example, midnight commander is not closeable pressed f10 key, it override the main window. KDE close midnight commander pressing f10 key.
Xkb layouts can not to do anything with this problem.

This bug is not exclusive to KDE. I use XFCE on a different machine as well, and encounter the bug there. Various people in this thread have reported it in other WMs. Is there a reason why the solution should not be, as the title says, that XKB kick its hotkeys on release rather than press?

Who invite me this blog?

(In reply to Kovács Viktor from comment #165)
> Why don't you change your layout switcher key-combination? You can set up
> another key-combinations for russian and different key-combination for
> english keyboard,too. That's KDE's problem, that allow choose frequently
> used key combinations.

This has nothing to do with KDE, but lack of functionality of xkb.

There is universal key sequence to switch layout which is common to most operating systems, once this sequence is selected, functionality is lost.

Comment#161 summaries the options to actually solve the issue, until resolved people should be able to land here to apply the patch which I use for 10 years.

Changed in xorg-server:
status: In Progress → Confirmed

Created attachment 134843
KDE keyboard layout switcher screenshot

Sorry, I'm Hungarian.

Original problem was, that Shishakov uses ctrl+shift keyboard layout keycombination, and it not works, because it can be used in hotkeys.
Why do not change It? It is much easier thing, I think.

@Kovács Viktor, this report is not only about "original" problem, but all the problems affected by current implementation. I described other one with modifier for national characters, once you define such key you cannot use it as shortcut modifier.

High, Viktor!

I'm using Ctrl+Shift for twelve years since Win XP. I use this combintaion on my win machines. So it's definetely not an option for me. Since I use Cyrillic layout I switch layouts frequently (people using Latin layouts are less affected). Imagine saving action shortcut "Ctrl+S" combintaion would be replaced with something like "Alt+R" in your favourite text editor.

I'm also sure that no one will complain if the patch will be merged. And I do not understand why should we follow the standard if this standard makes living uncomfortable.

BTW according to previous comments wayland implentations suffer from this bug too despite they do not depend on Xorg-server. Do we need separate patch for libxcb and libxcbcommon?

I understand, that you must switch between Russian and English layout. The programs uses latin-based hotkeys, I did understand. In my opinion, in the future would be change, if the translator projects "translate" the hotkeys, for example to cyrillyc letters, too. (then won't need switches between layouts so frequently) We (Hungarians) will run into that problems on the future, when we will want to write old Hungarian texts. This is a runic-like right-to-left script. My question is, do you use Windows yet, or you uses already only Linux? You can choose switcher combination closely positioned with ctrl and shift. If you buy a new laptop, it could be happen, that the keyboard metrics not exactly same as on previous one.

I use both Windows and Linux. BTW Many people don't have a choise of the OS on their jobs.

I may provide a patch that would make it available to switch the behaviour in the runtime (I guess a line in xorg.conf would be fine). So we don't break the standard, people don't need to recompile xorg every time and patch developers don't need to adapt the patch.

(In reply to Yan Pas from comment #176)
> I use both Windows and Linux. BTW Many people don't have a choise of the OS
> on their jobs.
>
> I may provide a patch that would make it available to switch the behaviour
> in the runtime (I guess a line in xorg.conf would be fine). So we don't
> break the standard, people don't need to recompile xorg every time and patch
> developers don't need to adapt the patch.

You should get developers' feedback about this approach first. If they are not willing to merge the patch that works via xorg.conf, you will only waste your time.

From the other hand side, you will probably waste your time anyway.
Developers talk about the "standard", and explicitely suggest sending patches to standard instead of patching xorg (read previous comments). And when such patch for the standard gets attached to this bug report, what happens? Nothing.

(In reply to Vitaly Shishakov from comment #0)
> I used to use Ctrl-Shift combination to switch keyboard layouts (ru <--> us)
>
> but in this case i cant use any of the Ctrl-Shift-* hotkeys in any software
> i try.
>
> I noticed, that the keyboard layout becomes swithced as soon an both keys
> are DOWN --
> pressing any other key is not treated as Ctrl-Shift-<key> combination.
>
> For example -- in Windows i also use Ctrl-Shift to switch layouts, but
> there, the layout
> becomes switched only when both SHIFT and CTRL keys are UP, and no other key
> was
> pressed while they were down -- in that case the hole combination is treates
> as
> Ctrl-Shift-<key> combination, and the layout is not changed.
>
> see also: http://bugs.kde.org/show_bug.cgi?id=59303
>
>
>
> I use the following lines in XF86Config:
>
> Section "InputDevice"
> Driver "Keyboard"
> Identifier "Keyboard[0]"
> Option "Protocol" "Standard"
> Option "XkbLayout" "us,ru"
> Option "XkbModel" "pc104"
> Option "XkbOptions" "grp:ctrl_shift_toggle"
> Option "XkbRules" "xfree86"
> Option "XkbVariant" ",winkeys"
> EndSection

Kubuntu grants Control+Shift+K combination. Is it acceptable?

(In reply to Kovács Viktor from comment #178)
> Kubuntu grants Control+Shift+K combination. Is it acceptable?

The question is not, largely speaking, about whether there is any shortcut available. The question is largely specifically about shortcuts such as Ctrl+Shift or Alt+Shift, which due to this bug will interfere with other shortcuts and applications. Users such as myself are accustomed to using these shortcuts, and they should be expected to work.

(In reply to Zebediah Figura from comment #179)
> (In reply to Kovács Viktor from comment #178)
> > Kubuntu grants Control+Shift+K combination. Is it acceptable?
>
> The question is not, largely speaking, about whether there is any shortcut
> available. The question is largely specifically about shortcuts such as
> Ctrl+Shift or Alt+Shift, which due to this bug will interfere with other
> shortcuts and applications. Users such as myself are accustomed to using
> these shortcuts, and they should be expected to work.

Yes, I was thinking about it before you answered. I tested RCtrl+RShift combination, and it has no conflicts with hotkeys. There are possibility of XKeyboard-config, I used it before a keyboard layout: caps_switch_latch. It works when capslock pushed, but not released. I just thinking, I am in a black room. But it cannot do anything with hotkeys. I think, that problem is a miner-like. X-windows have messages keypress and release, but in my opinion, it should be adopt all windows manager. I will read the according X11 header files first, I promiss. After that I come back again, could we step to an easy way or not.

196 comments hidden view all 250 comments
V-ctor (radioengineer) wrote :
Download full text (4.2 KiB)

How to make it works on 17.10?
There is no package xserver-xorg-core-hwe-xxx.
I did this:
1. sudo apt install devscripts
2. apt-get build-dep xorg-server
3. apt source xserver-xorg-core
4. wget https://bugs.freedesktop.org/attachment.cgi?id=129861
5 cd xkb
6. patch < attachment.cgi?id=129861
7. debuild -us -uc

and got:

# Make sure Xvfb at least starts up
PATH=debian/tmp/main/usr/bin/:/bin:/usr/bin \
  debian/tmp/main/usr/bin/xvfb-run -s "-screen 0 1280x1024x24 -nolisten tcp -noreset" true
install debian/local/xvfb-run.1 debian/tmp/main/usr/share/man/man1
make[1]: выход из каталога «/home/victor/Developing/XServer/xorg-server-1.19.5»
   debian/rules override_dh_install
make[1]: вход в каталог «/home/victor/Developing/XServer/xorg-server-1.19.5»
# dh_install --fail-missing
dh_install --list-missing
dh_install: Please use dh_missing --list-missing/--fail-missing instead
dh_install: This feature will be removed in compat 11.
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 1: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/lib/xorg/modules: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 2: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/bin/Xorg: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 3: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/bin/X: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 4: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/share/man/man1/Xorg.1: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 5: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/share/man/man4: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 6: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/share/man/man5/xorg.conf.5: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 7: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/share/man/man5/xorg.conf.d.5: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 8: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/bin/cvt: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 9: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/bin/gtf: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 10: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: main/usr/share/man/man1/cvt.1: not found
/home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-core.install: 11: /home/victor/Developing/XServer/xorg-server-1.19.5/debian/xserver-xorg-cor...

Read more...

Norbert (nrbrtx) wrote :

This bug is a duplicate of well known bug 1245473 .

tags: added: artful xenial
removed: amd64 third-party-packages
tags: added: bionic

In case you don't need to switch between keyboard layouts, you can get some shortcuts working again if you use the "Tweaks" tool for Gnome.

  sudo apt install gnome-tweak-tool

Then

1. Open "Tweaks"
2. Select the tab "Keyboard & Mouse"
3. Click "Additional Layout Options"
4. Disable entries in the "Switching to another layout" dialog

In my case this gave me back the "ALT + SHIFT" combinations which are essential in the Eclipse IDE for refactoring.

195 comments hidden view all 250 comments

Sorry, on newer Linux you can set up hot key combination for that problem as graphical UI settings, older Linux versions will not be updated. May I close It?

(In reply to Kovács Viktor from comment #181)
> Sorry, on newer Linux you can set up hot key combination for that problem as
> graphical UI settings, older Linux versions will not be updated. May I close
> It?

With all respect to you... Why do you want to close well described bug moreover that it has good proposed solution? This issue affects multiple users using multiple keyboard layouts and merging available patch probably won't cause any problems to the rest of people that does not use layout switchig.

(In reply to Jan Pohanka from comment #182)
> (In reply to Kovács Viktor from comment #181)
> > Sorry, on newer Linux you can set up hot key combination for that problem as
> > graphical UI settings, older Linux versions will not be updated. May I close
> > It?
>
> With all respect to you... Why do you want to close well described bug
> moreover that it has good proposed solution? This issue affects multiple
> users using multiple keyboard layouts and merging available patch probably
> won't cause any problems to the rest of people that does not use layout
> switchig.

Sorry, but where do you see "good proposed solution"? Please, please show me that solution.

(In reply to Kovács Viktor from comment #181)
> Sorry, on newer Linux you can set up hot key combination for that problem as
> graphical UI settings, older Linux versions will not be updated.

What exactly "newer Linux" is supposed to mean? I'm using yesterday's updated Gentoo Linux with xorg-server-1.19.5 and Fluxbox - is it counts as "newer"? Or by "newer Linux" you mean something like "modern KDE only"?

(In reply to k0fe from comment #183)
> Sorry, but where do you see "good proposed solution"? Please, please show me
> that solution.

There is a patch, working good enough for years without creating any new (practical) issues. In comment #161 is was proposed to make it configurable option to make everyone happy and let users choose between using compliant protocol or working hotkeys.

(In reply to Alex Efros from comment #184)
> (In reply to Kovács Viktor from comment #181)
> > Sorry, on newer Linux you can set up hot key combination for that problem as
> > graphical UI settings, older Linux versions will not be updated.
>
> What exactly "newer Linux" is supposed to mean? I'm using yesterday's
> updated Gentoo Linux with xorg-server-1.19.5 and Fluxbox - is it counts as
> "newer"? Or by "newer Linux" you mean something like "modern KDE only"?
>
> (In reply to k0fe from comment #183)
> > Sorry, but where do you see "good proposed solution"? Please, please show me
> > that solution.
>
> There is a patch, working good enough for years without creating any new
> (practical) issues. In comment #161 is was proposed to make it configurable
> option to make everyone happy and let users choose between using compliant
> protocol or working hotkeys.

Where is the link to the patch? Where is the instruction like how to apply this patch? And how can this comment be used by an ordinary user (without knowledge of programming) to solve this problem?

(In reply to k0fe from comment #185)
> (In reply to Alex Efros from comment #184)
> > There is a patch, working good enough for years without creating any new
> > (practical) issues. In comment #161 is was proposed to make it configurable
> > option to make everyone happy and let users choose between using compliant
> > protocol or working hotkeys.
>
> Where is the link to the patch? Where is the instruction like how to apply
> this patch? And how can this comment be used by an ordinary user (without
> knowledge of programming) to solve this problem?

As an ordinary Gentoo Linux user, I:
- download patch attached to this issue named "The same patch, but based on 1.19.1 (fixed)" into directory /etc/portage/patches/x11-base/xorg-server/
- run `emerge xorg-server` to reinstall Xorg with this patch applied
- restart X to enjoy working hotkeys :)

If users of other Linux distributions have issues with this - probably they just didn't use "newer Linux". </sarcasm>

(In reply to Kovács Viktor from comment #181)
> Sorry, on newer Linux you can set up hot key combination for that problem as
> graphical UI settings, older Linux versions will not be updated. May I close
> It?

Please do not close this bug. If you do not want to receive any further updates on it, you can unsubscribe by removing yourself from the Cc list.

(In reply to Alex Efros from comment #186)
> (In reply to k0fe from comment #185)
> > (In reply to Alex Efros from comment #184)
> > > There is a patch, working good enough for years without creating any new
> > > (practical) issues. In comment #161 is was proposed to make it configurable
> > > option to make everyone happy and let users choose between using compliant
> > > protocol or working hotkeys.
> >
> > Where is the link to the patch? Where is the instruction like how to apply
> > this patch? And how can this comment be used by an ordinary user (without
> > knowledge of programming) to solve this problem?
>
> As an ordinary Gentoo Linux user, I:
> - download patch attached to this issue named "The same patch, but based on
> 1.19.1 (fixed)" into directory /etc/portage/patches/x11-base/xorg-server/
> - run `emerge xorg-server` to reinstall Xorg with this patch applied
> - restart X to enjoy working hotkeys :)
>
> If users of other Linux distributions have issues with this - probably they
> just didn't use "newer Linux". </sarcasm>
I'd like to thank you! And great thanks to kyak for the patch!
I confirm that it works for me on "older" Gentoo and xorg-server 1.9.5.

There seems to have been a proposed protocol extension (comment #159 etc.) Can anyone shed light, for the outside user, as to the current status of this proposal? Thanks.

Alex (alexvaa) on 2017-12-07
Changed in xorg-server (Ubuntu):
assignee: nobody → Alex (alexvaa)

(In reply to Zebediah Figura from comment #189)
> Can anyone shed light, for the outside user, as to the current status of
> this proposal? Thanks.
No news since. Apart from the formal proposal, there are some old patches for its implementation:
https://lists.x.org/archives/xorg-devel/2012-November/034427.html
https://lists.x.org/archives/xorg-devel/2012-November/034430.html
https://lists.x.org/archives/xorg-devel/2012-November/034429.html
https://lists.x.org/archives/xorg-devel/2012-November/034431.html
https://lists.x.org/archives/xorg-devel/2012-November/034428.html

(In reply to Andreas Wettstein from comment #190)
> No news since. Apart from the formal proposal, there are some old patches
> for its implementation:
> https://lists.x.org/archives/xorg-devel/2012-November/034427.html
> https://lists.x.org/archives/xorg-devel/2012-November/034430.html
> https://lists.x.org/archives/xorg-devel/2012-November/034429.html
> https://lists.x.org/archives/xorg-devel/2012-November/034431.html
> https://lists.x.org/archives/xorg-devel/2012-November/034428.html

Here's what I think we would need to do in order to not break old clients:
https://lists.freedesktop.org/archives/xorg-devel/2013-January/035049.html

Another, probably better, way to do it would be to define a new flag like XkbSA_HasGroupFlags inside the XkbModAction flags field when group_flags and group_XXX are valid rather than potentially garbage. That would avoid the whole version-negotiation nightmare, as nothing appears to be too picky about extra flags being defined.

Five years later, it would also be good to have support inside libxkbcommon (which has a pretty decent test suite) and xcb-proto for the flags.

204 comments hidden view all 250 comments
Raycho Raykov (raycho-raykov) wrote :

I patched my Lubuntu 16.04 with the mentioned upward patch few hours ago and everything starts working perfectly. I also tested Linux Mint 18.3 with Cinnamon and everything works as expected without any patches. The problem exists in Ubuntu MATE 16.04 too. All these are 64 bit versions. The patch is created correctly: when I released first button from the sequence, the sequence is executed. This way when I switching locales and keep Shift pressed (I'm using Alt+Shift) I can start writing with capital letter. I hope this information is helpful.

205 comments hidden view all 250 comments

(In reply to Alex Efros from comment #184)
> There is a patch, working good enough for years without creating any new
> (practical) issues. In comment #161 is was proposed to make it configurable
> option to make everyone happy and let users choose between using compliant
> protocol or working hotkeys.

(In reply to Aliaksei Urbanski from comment #188)
> I'd like to thank you! And great thanks to kyak for the patch!
> I confirm that it works for me on "older" Gentoo and xorg-server 1.9.5.

I could to say, that this patch does not work exactly as expected. See, please, my comment #146 for explanation. So I think, this thread could not be closed.

Another user here voting for this bug to get patched OFFICIALLY from upstream.

Did you changed your opinion after for years of not fixing this bug?

Users still need this functionality (see https://community.ubuntu.com/t/keyboard-layout-switching-problems-and-poll/2876 and https://askubuntu.com/q/1009352/66509 as examples).

All current Ubuntu versions are affected and RHEL too. And nobody cares.

14 years of doing nothing. My congratulations!

(In reply to Daniel Stone from comment #191)
> Another, probably better, way to do it would be to define a new flag like
> XkbSA_HasGroupFlags inside the XkbModAction flags field when group_flags and
> group_XXX are valid rather than potentially garbage. That would avoid the
> whole version-negotiation nightmare, as nothing appears to be too picky
> about extra flags being defined.
>
> Five years later, it would also be good to have support inside libxkbcommon
> (which has a pretty decent test suite) and xcb-proto for the flags.

This comment lays out the best way forward for anyone interested to fix this bug. It shouldn't be too difficult, but personally I haven't worked on X11 for quite some time.

Just tested simple idea on Ubuntu 16.04.4 LTS with MATE DE.
Out-the-box it has Xorg 1.18.4 which perfectly allow user to set for example <Ctrl+Shift> keyboard shortcut for keyboard layout switching.
But when I install HWE on 16.04 LTS I get newer Xorg 1.19.5.

Debian 8 (Xorg 1.16.4) and 9 (Xorg 1.19.2) have this problem too (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891915 ).

So versions 1.16.4, 1.19.2 and 1.19.5 should be patched to bring <Ctrl+Shift> keyboard shortcut functionality back.

209 comments hidden view all 250 comments
Norbert (nrbrtx) wrote :

From duplicate bug 1720364 report.

Steps to reproduce:
1. Install ubuntu-mate-desktop on Ubuntu 16.04 LTS with HWE (Xorg 1.19.5), or 17.10 or 18.04 LTS.
2. Set-up two keyboard layouts - English and Russian
3. Set <Ctrl+Shift> as keyboard layout switcher
4. Try to use shortcuts starting from <Ctrl+Shift>:
4.1. Open Firefox, open new tab, go to some site in it, close tab, try to click <Ctrl+Shift+T> to restore closed tab.
4.2. Open mate-terminal, try to open new tab with <Ctrl+Shift+T>, or copy (<Ctrl+Shift+C>), or paste (<Ctrl+Shift+V>).
4.3. Open pluma, write some text, try to navigate in it with <Ctrl+Shift+arrow>.

Expected results:
<Ctrl+Shift> switches keyboard layout, shortcuts starting from <Ctrl+Shift+...> work normally.

Actual results:
<Ctrl+Shift> switches keyboard layout, shortcuts starting from <Ctrl+Shift+...> do not work.

Notes:
1. Ubuntu 16.04 LTS (Xorg 1.18.4) with Marco and Compton work normally with <Ctrl+Shift> keyboard layout switcher.
2. This problem was discovered before on 13.10, 14.04 and other modern versions with GNOME desktop (Metacity and Compiz) - see bug 1245473.

tags: removed: zesty
description: updated
description: updated
Changed in xorg (Debian):
status: Unknown → New
A (zorn-v) wrote :

https://gist.github.com/zorn-v/df0dccd14af81e017fbe8a4e1523ddf5

There is a script I run if x.org updated.
Fuck X.Org contributors and FUCK they minds.

209 comments hidden view all 250 comments

Did somebody tested Russian rulemak keyboard layout? It is between the extra layouts. It is based on russian layout with latin letters. I' m not a russian man, but I think, just testing first is a good idea!

Viktor, could you please elaborate how exactly that may be useful here?

I would also like to ask you to make sure you contribute useful content to this discussion, or if you cannot, resist from posting. I don’t think it helps anyone to to support flamewars in this bug report, or even make the discussion longer than necessary.

209 comments hidden view all 250 comments
Norbert (nrbrtx) wrote :

I attached patch from ArchLinux AUR (https://aur.archlinux.org/packages/xorg-server-bug865/, https://aur.archlinux.org/cgit/aur.git/tree/freedesktop-bug-865.patch?h=xorg-server-bug865 ). This patch is stable and reliable. ArchLinux users are happy with it.

It fixes current bug on Ubuntu Bionic Beaver 18.04 LTS.
I have tested it with <Ctrl+Shift> keyboard layout switcher on GNOME (DESKTOP_SESSION="ubuntu") and MATE desktop (DESKTOP_SESSION="mate").

Please kindly review it and consider applying it before official final release of 18.04 LTS.
I'm ready to test proposed packages which (I hope) you would create.
As the result Ubuntu users will be as happy as ArchLinux's users.

The attachment "Patch for Bionic Beaver 18.04 LTS, it fixes the problem" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Anton V Zharnikov (antonprogz) wrote :

This helped me:

https://gist.github.com/elw00d/0826917118d58e81843e2d11bc6cf885

Be aware of xserver version numbers.

Khurshid Alam (khurshid-alam) wrote :

@Norbert

Can you make ppa with the patch so that everyone test it easily?

Norbert (nrbrtx) wrote :

@khurshid-alam

I can't determine how many users want to have this bug fixed. So we can start with the complete working instruction:

1. Set Ctrl+Shift keyboard layout switcher on Ubuntu 18.04 LTS
2. Ensure that Ctrl+Shift+ interference exists
3. Enable "deb-src" sources (via `software-properties-gtk`), then apply the patch

cd ~/Downloads
apt-get source xserver-xorg-core
cd xorg-server-1.19.6/
wget https://aur.archlinux.org/cgit/aur.git/plain/freedesktop-bug-865.patch?h=xorg-server-bug865 -O freedesktop-bug-865.patch
patch xkb/xkbActions.c < freedesktop-bug-865.patch

sudo apt-get install devscripts
sudo apt-get build-dep xserver-xorg-core
debuild -uc -us
sudo dpkg -i ../x*.deb

4. Reboot and test again.

206 comments hidden view all 250 comments
Elad Hen (eladhen2) wrote :

@Norbert
Is there a way to apply this patch to debian stretch (xorg 1.19.2)?

FYI the bug may be temporarily fixed on Ubuntu 16.04 LTS (with HWE), Ubuntu 18.04 LTS (and Mint 19) using packages from my PPA ( https://launchpad.net/~nrbrtx/+archive/ubuntu/xorg-hotkeys or " ppa:nrbrtx/xorg-hotkeys " ). It contains patched Xorg (with patch from kyak - https://aur.archlinux.org/packages/xorg-server-bug865/ ). Thank you very much again, kyak!

And it is unbelievable that we need to patch core graphical system component by ourselves to use traditional keyboard shortcuts ...

Snaker (snaker.me) wrote :

@Norbert
I have the same problem on Ubuntu 18.04 LTS with GNOME.
I tried your instruction from #40 without any success. Do you have an idea how to make it work?

P.S. How can I roll back changes?

Snaker (snaker.me) wrote :

@Norbert
Update:
After cleaning up changes and applying your ppa:nrbrtx/xorg-hotkeys it fixes the issue partially - it still change input language on key press, but allow to use shortcuts <Ctrl+Shift+...> (with changing language in the process).

Displaying first 40 and last 40 comments. View all 250 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.