Created attachment 1107474 [details] Test program which calls XkbLockGroup and checks locked group Description of problem: XkbLockGroup function call made in an application does not have desired effect in Gnome 3.18: in a very short time the index of locked group is reset to the index set by Gnome. Version-Release number of selected component (if applicable): Fedora 23 gnome-shell-3.18.3-1.fc23.x86_64 How reproducible: Always. Steps to Reproduce: 1. Download the attached test program. 2. Compile it: g++ -o lockgroup -lX11 lockgroup.cpp 3. Make sure you have more than one "input sources" (settings -> keyboard -> input sources). 4. Select the first source (for example, by clicking on the keyboard indicator in the top row and selecting the first "input source" from the list). 5. Run compiled program: ./lockgroup 1 Actual results: Keyboard state: group 0 (base 0, locked 0, latched 0) Locking group 1... Keyboard state: group 1 (base 0, locked 1, latched 0) Keyboard state: group 0 (base 0, locked 0, latched 0) # Note: locked group is reset back to 0 in a short time. Expected results: Keyboard state: group 0 (base 0, locked 0, latched 0) Locking group 1... Keyboard state: group 1 (base 0, locked 1, latched 0) Keyboard state: group 1 (base 0, locked 1, latched 0) Additional info: Test program (lockgroup) accepts one argument: index of group to lock. It should be an integer from 0 to 3. The test may be completed in another way: select the second (or third or fourth input source) and run ./lockgroup 0 -- the point is in attempting to lock non-currently-selected "input source". This behavior breaks all 3rd-party keyboard switchers. This behavior is introduced in Gnome 3.18, XkbLockGroup in Gnome 3.16 works as expected.
I found code which resets locked group. See mutter-3.18.2/src/backends/x11/meta-backend-x11.c line ~ 311 (function handle_host_xevent): > case XkbStateNotify: > if (xkb_ev->state.changed & XkbGroupLockMask) > { > if (priv->locked_group != xkb_ev->state.locked_group) > XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, priv->locked_group); > } These lines was introduced by the commit https://git.gnome.org/browse/mutter/commit/src/backends/x11/meta-backend-x11.c?id=2857fdbdb887fcaa2e2f25d268c34ae039646e78 I am not aware about Ubuntu, but this change kills plain-old-X11 keyboard switchers.
See also https://bugzilla.gnome.org/show_bug.cgi?id=756543 Unfortunately, I can't reopen that bug.
Looks like in Fedora 24 the mutter package has reverted that ugly Ubuntu patch...
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Looks like the problem was fixed in F24.