Bug 1292976 - XkbLockGroup does not have effect because Gnome 3.18 resets locked group
XkbLockGroup does not have effect because Gnome 3.18 resets locked group
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: gnome-shell (Show other bugs)
23
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Owen Taylor
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-18 17:33 EST by Van de Bugger
Modified: 2016-12-20 12:09 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 12:09:54 EST
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)
Test program which calls XkbLockGroup and checks locked group (1.95 KB, text/x-csrc)
2015-12-18 17:33 EST, Van de Bugger
no flags Details

  None (edit)
Description Van de Bugger 2015-12-18 17:33:11 EST
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.
Comment 1 Van de Bugger 2015-12-22 03:28:54 EST
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.
Comment 2 Van de Bugger 2015-12-22 03:49:37 EST
See also https://bugzilla.gnome.org/show_bug.cgi?id=756543

Unfortunately, I can't reopen that bug.
Comment 3 Van de Bugger 2016-06-27 18:21:33 EDT
Looks like in Fedora 24 the mutter package has reverted that ugly Ubuntu patch...
Comment 4 Fedora End Of Life 2016-11-24 09:21:35 EST
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.
Comment 5 Fedora End Of Life 2016-12-20 12:09:54 EST
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.

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