diff --git a/src/preferences/keymap/KeyboardLayoutView.cpp b/src/preferences/keymap/KeyboardLayoutView.cpp index 93d34ff896..e1330f8c1d 100644 --- a/src/preferences/keymap/KeyboardLayoutView.cpp +++ b/src/preferences/keymap/KeyboardLayoutView.cpp @@ -108,6 +108,13 @@ KeyboardLayoutView::FrameResized(float width, float height) } +void +KeyboardLayoutView::WindowActivated(bool active) +{ + if (active) + Invalidate(); +} + BSize KeyboardLayoutView::MinSize() { @@ -482,7 +489,8 @@ KeyboardLayoutView::MessageReceived(BMessage* message) && fModifiers != newModifiers) { fModifiers = newModifiers; _EvaluateDropTarget(fDropPoint); - Invalidate(); + if (Window()->IsActive()) + Invalidate(); } break; } @@ -947,7 +955,7 @@ KeyboardLayoutView::_KeyChanged(const BMessage* message) uint8 diff = fKeyState[i] ^ state[i]; fKeyState[i] = state[i]; - if (!checkSingle) + if (!checkSingle || !Window()->IsActive()) continue; for (int32 j = 7; diff != 0; j--, diff >>= 1) { diff --git a/src/preferences/keymap/KeyboardLayoutView.h b/src/preferences/keymap/KeyboardLayoutView.h index 2379ec182e..4796304483 100644 --- a/src/preferences/keymap/KeyboardLayoutView.h +++ b/src/preferences/keymap/KeyboardLayoutView.h @@ -43,7 +43,7 @@ protected: virtual void Draw(BRect updateRect); virtual void MessageReceived(BMessage* message); - + virtual void WindowActivated(bool active); private: enum key_kind { kNormalKey,