diff --git a/uppsrc/CtrlCore/X11Wnd.cpp b/uppsrc/CtrlCore/X11Wnd.cpp index c3d9a0c6b..c23bff178 100644 --- a/uppsrc/CtrlCore/X11Wnd.cpp +++ b/uppsrc/CtrlCore/X11Wnd.cpp @@ -836,9 +836,10 @@ void Ctrl::TakeFocus() return; } LLOG("TAKE_FOCUS " << Name()); - ClearKbdState_(); - if(IsEnabled() && IsVisible() && top->window != GetXServerFocusWindow()) + if(IsEnabled() && IsVisible() && top->window != GetXServerFocusWindow()) { + ClearKbdState_(); SetWndFocus(); + } if(this != focusCtrlWnd) { if(IsEnabled()) { SetLastActive(w, this);