#363 Alt-Tab problem under krdc

Future
open
nobody
krdc (1)
5
2013-02-12
2013-02-12
Paweł Pałucha
No

Hi, I was following KRDC bug described here: https://bugs.kde.org/show_bug.cgi?id=200776, also debian bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686274.

In short, the problem is that when using krdc with rdesktop and switching focus to other application with Alt-Tab, pressing of Alt is recorded inside rdesktop, but releasing not, so rdesktop still thinks that Alt is pressed. The same is for other "state" keys (shift, ctrl, caps, numlock). This is the same behavior as described in rdesktop SR #1184205. As I understand from looking at the code, the fix was to call reset_modifier_keys() in xwin_process_events() on event FocusIn.

It works fine for standalone rdesktop, but does not work when rdesktop window is embedded in KRDC (using -X rdesktop option). In this case, switching focus in/out of krdc does not necessarily triggers FocusIn/Out events in rdesktop. The handling of focus/activation looks quite complex in krdc, but I believe that generally it's proper and we should not expect to have FocusIn sent every time. But we have other event - EnterNotify - that is sent correctly both with rdesktop standalone and embedded.

I made test modification of rdesktop, moving call of reset_modifier_keys() from FocusIn to EnterNotify case branch in xwin_process_events(). It works for me - Alt is properly released in both standalone and krdc usage scenarios.

Please see attached patch.

Regards
Paweł

1 Attachments

Discussion