To those who are experiencing this, can you please post details:
setxkbmap -query
and setxkbmap -print
Thanks
rules: evdev model: pc105 layout: fi,latam variant: , options: grp:alts_toggle
xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+fi+latam:2+inet(evdev)+level3(ralt_switch_for_alts_toggle):1+level3(ralt_switch_for_alts_toggle):2+group(alts_toggle)" }; xkb_geometry { include "pc(pc105)" }; };
Steps to reproduce: 1) xpra start --no-daemon --start-child gnome-terminal --exit-with-children :9 -d all > xpra.server.txt 2>&1 2) xpra -d all attach :9 > xpra.client.txt 2>&1 3) wait for gnome-terminal to appear, move mouse over it 4) type a, b, c, d, e, f 5) hit alt-tab to switch to some other window 6) hit alt-tab again to switch back to gnome-terminal 7) type f
Expected results: 4) & 7) gnome-terminal reads "abcdeff"
Actual results: 4 & 7) gnome-terminal reads "abcdef" and the File menu is open (since alt+F opens it)
More info: 1) xpra.server.txt and xpra.client.txt are attached.
Oh and yes, I'm using gnome.
Also, keys getting stuck cause a lot of weird effects. For example starting xpra can take minutes. Apparently this is because of xmodmap:
$ xpra start --no-daemon --use-display :7 found /home/lindi/xpra-install/amd64/v0.0.7.22-60-ga4aabe0/ Xlib: extension "RANDR" missing on display ":7.0". Xlib: extension "RANDR" missing on display ":7.0". Xlib: extension "RANDR" missing on display ":7.0". Missing window or missing property or wrong property type WM_TRANSIENT_FOR (window) Missing window or missing property or wrong property type _NET_WM_STRUT_PARTIAL (strut-partial) Missing window or missing property or wrong property type _NET_WM_STRUT (strut) Missing window or missing property or wrong property type _NET_WM_STRUT_PARTIAL (strut-partial) Missing window or missing property or wrong property type _NET_WM_STRUT (strut) xmodmap: please release the following keys within 2 seconds: Control_L (keysym 0xffe3, keycode 37) d (keysym 0x64, keycode 40) KP_Up (keysym 0xff97, keycode 80) xmodmap: please release the following keys within 4 seconds: Control_L (keysym 0xffe3, keycode 37) d (keysym 0x64, keycode 40) KP_Up (keysym 0xff97, keycode 80) xmodmap: please release the following keys within 8 seconds: Control_L (keysym 0xffe3, keycode 37) d (keysym 0x64, keycode 40) KP_Up (keysym 0xff97, keycode 80) xmodmap: please release the following keys within 16 seconds: Control_L (keysym 0xffe3, keycode 37) d (keysym 0x64, keycode 40) KP_Up (keysym 0xff97, keycode 80) xmodmap: please release the following keys within 32 seconds: Control_L (keysym 0xffe3, keycode 37) d (keysym 0x64, keycode 40) KP_Up (keysym 0xff97, keycode 80) xmodmap: unable to set modifier mapping, keyboard problem Randr not supported: X server does not support required extension Randr randr enabled: False xpra is ready.
$ grep key-action xpra.client.txt writing ['key-action', 1, 'a', True, [], 97, 'a', 38] writing ['key-action', 1, 'a', False, [], 97, 'a', 38] writing ['key-action', 1, 'b', True, [], 98, 'b', 56] writing ['key-action', 1, 'b', False, [], 98, 'b', 56] writing ['key-action', 1, 'c', True, [], 99, 'c', 54] writing ['key-action', 1, 'c', False, [], 99, 'c', 54] writing ['key-action', 1, 'd', True, [], 100, 'd', 40] writing ['key-action', 1, 'd', False, [], 100, 'd', 40] writing ['key-action', 1, 'e', True, [], 101, 'e', 26] writing ['key-action', 1, 'e', False, [], 101, 'e', 26] writing ['key-action', 1, 'f', True, [], 102, 'f', 41] writing ['key-action', 1, 'f', False, [], 102, 'f', 41] writing ['key-action', 1, 'Alt_L', True, [], 65513, '', 64] writing ['key-action', 1, 'Tab', False, [], 65289, '', 23] writing ['key-action', 1, 'f', True, [], 102, 'f', 41] writing ['key-action', 1, 'f', False, [], 102, 'f', 41]
shows pretty clearly that the problem is client-side. Client never tells the server that I have released Alt.
proof-of-concept to fix the bug
Since this bug really interferes with my ability to use the computer here's a proof-of-concept that works for me(tm) but definitely needs futher polishing.
Seems this is still not sufficient. At least quassel opens the menu if I press alt, release alt and then hit f. So, sending release event for alt is not enough.
another prototype to fix the problem
It seems that if I send the release events when the window receives focus again then applications correctly handle this.
The problem is not solved client-side at the moment (and I'm not sure it should be either).
The code you are looking for is _make_keymask_match
in server.py
It fires whenever we get keypresses and is meant to ensure the modifiers set on the server match the ones set in the client. Not sure why it stopped working since the keymap changes but now that I have your keymap details I should be able to reproduce.
Also non-modifiers get stuck so I don't see how that code would help alone?
In fact, the _make_keymask_match
must be server-side, as the client has no way of knowing what state the session is in at the moment, so this is the best place to do it.
Can you give me steps for getting non-modifier keys to get stuck? Do you get that often?
We now apply the full keymap, using 'xmodmap -pke
' to grab all the raw keyval mappings from the client (if available) - done in r137
We now also clear all modifiers when a new client attaches to a session (r138), this should fix the xmodmap timeout (which I have not seen myself before).
Now, on to the alt-key gets stuck proper...
Yes, I often have one of the arrow keys stuck. You can imagine that this leads to rather bad behavior in different applications :-)
r139 batches the keymap updates and ensures we don't get the same xmodmap timeouts when keymap-changed fires: we also send the client's current modifiers and set them.
I just can't get the alt-tab to get stuck, despite setting my keyboard to as per comment:2
Here's how the Up arrow gets stuck with r135:
$ xpra start --no-daemon --start-child gnome-terminal --exit-with-children :9 -d all > xpra.server.txt 2>&1 $ xpra -d all attach :9 > xpra.client.txt 2>&1 # hold the up arrow down # notice how the shell is going through all your history entries # hit alt-tab # hit alt-tab again $ grep -E "(key-action|focus)" xpra.client.txt writing ['focus', 1] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Up', True, [], 65362, '', 111] writing ['key-action', 1, 'Alt_L', True, [], 65513, '', 64] writing ['key-action', 1, 'Up', True, ['meta'], 65362, '', 111] writing ['key-action', 1, 'Up', True, ['meta'], 65362, '', 111] writing ['focus', 0] writing ['focus', 1] writing ['key-action', 1, 'Alt_L', True, [], 65513, '', 64] writing ['focus', 0]
The client never tells the server that I released the up arrow!
r142 ensures that we clear the keys that are currently pressed when we lose focus, we also send the list of modifiers when we gain focus so we can set them correctly again if any are set. This should fix the problem with "arrow keys get stuck", but probably not "alt gets stuck"... Please confirm if this is an improvement for you.
testing the alt-tab issue on Debian Squeeze (screenshot)
I've just tested on r142 on a fresh install of Debian Squeeze, as you can see on the screenshot the keyboard is set to finnish. I've tried and tried again to reproduce the bug and I just can't do it! :(
Do I need to launch another VM with Debian Sid on it?
Another commit related to stuck keys: clear keys when client disconnects and ensure we don't re-set them by ignoring any packets arriving in the new "closing" state.
Finally, this is for the very unusual case where the server is control-Ced from within the client (via screen) and we end up with the control key stuck:
r159 always clears the modifiers on startup so users can re-attach to an existing display (with -use-display=
) and not have xmodmap timeouts.
r187 improves this further
Although I have seen the 'C' key getting stuck when I ^C
the server from within xpra via screen, this is a unusual scenario and should no longer cause timeouts when re-starting the server.
Lowering priority, please raise again if any of this is wrong.
Not heard anything for 3 months, closing.
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/13