With global layout mode (X default, when no layout tool is used) layout can get out of sync: when xpra window is in focus, layout switches both on client and on server. When xpra window is out of focus, layout is only switched on client. When xpra recieves focus again, layouts can be inverted between client and server.
When using per-app mode (i.e. gxkb provides that, other tools like qxkb, gnome-settings-daemon can be configured also), layout is remembered per application (supposedly by PID). This works fine (omitting that all xpra windows get the same layout, but that is expected) for some time, until at some point it gets out of sync and becomes inverted also. Perhaps, when xpra window gains or looses focus it may or may not catch layout change.
I haven't tested any per-window mode, but supposedly it should have similar problem to per-app mode.
So, the main problem is that layout on server can become different than layout on client. Switching several times while xpra window is in focus re-syncs layouts. Also, witching layouts by gxkb tray icon, even when xpra window is in focus, does not affect layout on server.
We detect that the layout has changed using keys-changed signal of gtk.gdk.Keymap, maybe it isn't firing when it should. We could try to use the X11 hooks to make sure we get all such events.
Split from #1027 which is for win32.
Can you post the
-d keyboard output of such events?
Attached the client terminal output. Attached to server, started leafpad, typed something in 'us' layout, switched to 'ru', typed again, changed to other window (local with 'en' layout), changed back to xpra leafpad window which should have 'ru' layout, typed, got latin characters. Gxkb icon showed ru layout for this window.
Maybe #1380 will help?
Tested in 2.0-20161223r14589-1. Layout seem to stay in sync with what is currently selected locally on the client. Fixed, thanks!
(typo in title)
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1234