From d38ba8f7dd3c2a0912d641b63e9cc031d962798a Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 13 Aug 2013 13:05:01 -0400 Subject: [PATCH] ControlLook: Check IsFocus() first Otherwise we make two unnecessary function calls for every control in a window where only one of them is the focus control. Thanks Stippi. --- src/kits/interface/ControlLook.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp index 3642300ed4..d50cbc9787 100644 --- a/src/kits/interface/ControlLook.cpp +++ b/src/kits/interface/ControlLook.cpp @@ -87,8 +87,8 @@ BControlLook::Flags(BControl* control) const if (!control->IsEnabled()) flags |= B_DISABLED; - if (control->Window() != NULL && control->Window()->IsActive() - && control->IsFocus()) { + if (control->IsFocus() && control->Window() != NULL + && control->Window()->IsActive()) { flags |= B_FOCUSED; }