From d47410e075e44a445429f3f8d83bc7fdaf6bdbd0 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 13 May 2009 13:49:00 +0000 Subject: [PATCH] * avoid key highlighting unless the preflet window is active, at least I've found it pretty silly that the Keymap preflet would document all my keypresses although I'm doing something elsewhere git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30745 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/keymap/KeyboardLayoutView.cpp | 12 ++++++++++-- src/preferences/keymap/KeyboardLayoutView.h | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) 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,