By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 100

Summary: Keyboard layout switcher does not work
Product: TDE Reporter: Ilya <neptunia>
Component: systemAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED FIXED    
Severity: major CC: bugwatch, darrella, johnbull1066, julius.schwartzenberg, michele.calgaro, ogldelphi, sid_evg, slavek.banko
Priority: P5    
Version: 3.5.13.x [Trinity]   
Hardware: Other   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on:    
Bug Blocks: 2247    
Attachments: add russian layout
xkb options

Description Ilya 2009-07-02 08:53:25 CDT
Keyboard switching of layout does not work: only using mouse and clicking indicator it is possible to change layout.
Comment 1 RJ 2011-08-11 15:52:17 CDT
Yes, russian keyboard switch doesn't work, but we are using a workaround called kkbswitch (http://kkbswitch.sourceforge.net/). Is it possible integrate it in Trinity?
Comment 2 Timothy Pearson 2011-08-11 19:04:42 CDT
See Bug 493 for the packaging request.
Comment 3 Ilya 2011-08-12 01:12:06 CDT
Actually the standard layout switcher works well here on KDE 3.5.10 in openSUSE. It works flawlessly.
Comment 4 Timothy Pearson 2011-08-12 01:42:35 CDT
So you are only running into an issue with the keyboard shortcuts?  Can you please provide a brief test case, describing:
1.) Your interaction with the program (in detail, e.g. I press "alt+something" when I am at the main Trinity desktop)
2.) What you expect to happen
3.) What actually happens?

This will help us isolate the offending code rapidly.

Thanks!
Comment 5 Ilya 2011-08-12 02:03:38 CDT
All works well for me now.
Comment 6 Timothy Pearson 2011-08-12 02:57:41 CDT
If this is no longer a bug in version 3.5.12 or higher of Trinity, please close this bug report as RESOLVED INVALID.

Thanks!
Comment 7 RJ 2011-08-12 07:58:30 CDT
Created attachment 74 [details]
add russian layout

add russian layout.
Comment 8 RJ 2011-08-12 07:59:00 CDT
Created attachment 75 [details]
xkb options

xkb options
Comment 9 RJ 2011-08-12 08:01:46 CDT
I add russian layout and set xkboptions to Alt+Shift and press Apply. So, if I press Alt+Shift - nothing happens and layout doesn't switch as it is in standart KDE 3.5.10.
Am I doing something wrong?
Comment 10 Timothy Pearson 2011-08-12 12:24:04 CDT
(In reply to comment #9)
> I add russian layout and set xkboptions to Alt+Shift and press Apply. So, if I
> press Alt+Shift - nothing happens and layout doesn't switch as it is in
> standart KDE 3.5.10.
> Am I doing something wrong?

Which version of KDE3/Trinity are you experiencing this problem under?
Comment 11 RJ 2011-08-13 04:36:06 CDT
(In reply to comment #10)
> Which version of KDE3/Trinity are you experiencing this problem under?

I'm using TDE 3.5.12 with Debian Squeeze
Comment 12 RJ 2011-08-19 14:21:30 CDT
Same with 3.5.13 nightly build.
Comment 13 Julius Schwartzenberg 2012-02-07 17:14:34 CST
This problem is a regression that is related to newer versions of the X.org X11 server. It does not seem to be related to the version of setxkbmap however, but really to the version of X11 server.

I do not have this problem with the stock X.org server from Ubuntu Lucid (version 1.7.6). When I upgraded my X.org server on Lucid to version 1.10.4 the switching stopped working properly for me. Now I'm running Trinity on Ubuntu Precise (12.04) with X.org version 1.11.3 and it does not work either. 

The problem is in at least version 3.5.11 and 3.5.13 of Trinity. KDE4 does not have any problems and works fine with the newer X.org server versions. Debian Squeeze uses X.org 1.7.7 it seems, so maybe the problem is related to a change that happened between X.org 1.7.6 and 1.7.7.

The flag of Trinity's layout switcher does get updated properly and is also remembered for each window if you have a separate layout per window. The layout always stays on the first one however.

There is one work-around:
When you press the key you use to switch layouts and then also press any other key before you release the switching key, there will be a proper switch to the new layout. This is then even remembered properly for that window as well.

Timothy, this can be complicated to understand and reproduce if you are not experienced with special keyboard layouts. If you need help with reproducing this you can write me any time on IRC (Z_God) and I will help with reproducing this problem. It is very inconvenient for users that need to write multiple alphabets so a solution would be very welcome.
Comment 14 Julius Schwartzenberg 2012-02-09 17:49:27 CST
It seems that initially after start-up, this bug does not occur. After restarting the layout switcher, it will work properly for some seconds (or switches?) and then it will be broken again.
Comment 15 Timothy Pearson 2012-06-12 23:26:11 CDT
Is this bug still happening in the R14 nightly builds?  I have been debugging the kxkb tool and have yet to see any truly broken behaviour, although the documentation for kxkb does not generally line up with how the program actually behaves.
Comment 16 Julius Schwartzenberg 2012-06-14 05:48:09 CDT
It still doesn't work here, the installed tdebase-trinity-bin package version is: 4:14.0.0-0ubuntu7+r735+pr47~precise

More info on the exact behavior. When you quit kxkb and the start it again, the first switch will always work correctly! The second time an attempt to switch is made, only the flag changes (except when using the work-around: holding an extra button). Restarting kxkb will once again allow the switching to work once properly and then it breaks again.

I use caps lock to switch between layouts here btw., which is a common key for this purpose. Once you add grp:caps_toggle to your xkboptions, you can also change the kxkb shortcut from ctrl+alt+k to it. (It should show up as ISO_NEXTGROUP or something like that.) I think with the default ctrl+alt+k I saw the exact same issue however.
Comment 17 Julius Schwartzenberg 2012-07-04 16:04:32 CDT
This problem does not occur on Debian Squeeze with X.org 2:1.7.7-14, it seems to be a Ubuntu-only issue.
Comment 18 Julius Schwartzenberg 2012-07-05 16:57:51 CDT
I just reproduced this problem in Ubuntu Natty. It initially did *not* occur with the default shortcut ctrl+alt+k, but when I switched it to ISO_Next_Group, the switching stopped working correctly.
Comment 19 Timothy Pearson 2012-07-05 17:13:06 CDT
I don't think there is a way to change the shortcut, which in and of itself qualifies as a bug.  What you probably changed was a shortcut key for the underlying xkbd program.
Comment 20 Julius Schwartzenberg 2012-07-05 17:29:06 CDT
There is:
1. Open the "Keyboard & Mouse" control pane
2. Goto Keyboard Shortcuts 
3. Under "Shortcut Schemes", "Global Shortcuts", scroll to the bottom

There you will find "Switch to Next Keyboard Layout". This shortcut should be set to ISO_Next_Group (by pressing the key that's set switch the group in xkb, I use caps).
Comment 21 Julius Schwartzenberg 2012-07-06 10:29:38 CDT
Seems I found the cause of the issue. Starting with Ubuntu Natty, a patch 208_switch_on_release.diff is included in the xorg-server package which alters the xkb layout switching behavior. This breaks Trinity's kxkb.
It does not break the layout switcher in KDE 4, so it should be possible to work around this on the Trinity side.

On Debian, this patch is not included and everything works correctly. The stock X.org versions on Lucid and Maverick also do not have this patch and they also do not have the issue. The problem exists in Ubuntu Natty and later versions of Ubuntu.
Comment 22 Julius Schwartzenberg 2012-07-06 10:38:47 CDT
It seems this switch_on_release patch is intended to solve this issue:
https://bugs.freedesktop.org/show_bug.cgi?id=865

https://bugs.archlinux.org/task/29190


The patch has also been included in OpenSUSE at one point or another (I'm not aware of the current situation), which explains why Ilya saw the same issue on OpenSUSE.
https://build.opensuse.org/package/view_file?file=switch_on_release.diff&package=xorg-x11-server&project=home%3Aslavb18%3Abranches%3AX11
Comment 23 Darrell 2013-04-13 15:07:19 CDT
Is this problem still valid?
Comment 24 Julius Schwartzenberg 2013-04-21 10:21:38 CDT
For 3.5.13.1 it is still an issue. As soon as the nightly build will be useable, I will try this for R14, but it's likely the problem is not solved yet.
Comment 25 Darrell 2013-08-17 12:30:59 CDT
Is this report still valid?
Comment 26 Julius Schwartzenberg 2013-09-07 05:22:13 CDT
Probably yes. More investigation shows that this is related to the DCOP signal being sent and processed as soon as a key is pressed instead of when it is released.

I will test it again with the new nightlies to be sure however.
Comment 27 Julius Schwartzenberg 2013-09-08 08:49:03 CDT
I just tested. This bug is still present in the current R14 nightlies.
Comment 28 sid_evg 2019-06-05 13:16:58 CDT
It's 2019 and I'm still having this issue? 
Will this ever be fixed?
Comment 29 Michele Calgaro 2023-03-24 08:56:16 CDT
This has been fixed by the following PR on TGW:
https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/pulls/304

Please reopen this bug (or better file an Issue on TGW) if you still have issues.