fixed a small problem with StealFocus and RestoreFocus
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18148 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
39d02f8967
commit
cf2ef43abd
@ -493,6 +493,10 @@ BMenuBar::Track(int32 *action, int32 startIndex, bool showMenu)
|
||||
void
|
||||
BMenuBar::StealFocus()
|
||||
{
|
||||
// We already stole the focus, don't do anything
|
||||
if (fPrevFocusToken != -1)
|
||||
return;
|
||||
|
||||
BWindow *window = Window();
|
||||
if (window != NULL && window->Lock()) {
|
||||
BView *focus = window->CurrentFocus();
|
||||
@ -515,11 +519,11 @@ BMenuBar::RestoreFocus()
|
||||
BView *view = dynamic_cast<BView *>(handler);
|
||||
if (view != NULL && view->Window() == window)
|
||||
view->MakeFocus();
|
||||
fPrevFocusToken = -1;
|
||||
|
||||
} else if (IsFocus())
|
||||
MakeFocus(false);
|
||||
|
||||
fPrevFocusToken = -1;
|
||||
window->Unlock();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user