begin to fix bug #658:
makes use of BWindow::_SetFocus() in BView::MakeFocus() BWindow::_KeyboardNavigation() now uses BView::MakeFocus() This is though not enough: _SetFocus isn't called on window activation/deactivation, thus the input server isn't aware of a focus view change in this case. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17723 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
360e569a2c
commit
79adc02bc6
@ -1386,13 +1386,11 @@ BView::MakeFocus(bool focusState)
|
|||||||
if (focus && focus != this)
|
if (focus && focus != this)
|
||||||
focus->MakeFocus(false);
|
focus->MakeFocus(false);
|
||||||
// if we want to make this view the current focus view
|
// if we want to make this view the current focus view
|
||||||
fOwner->fFocus = this;
|
fOwner->_SetFocus(this, true);
|
||||||
fOwner->SetPreferredHandler(this);
|
|
||||||
} else {
|
} else {
|
||||||
// we want to unfocus this view, but only if it actually has focus
|
// we want to unfocus this view, but only if it actually has focus
|
||||||
if (focus == this) {
|
if (focus == this) {
|
||||||
fOwner->fFocus = NULL;
|
fOwner->_SetFocus(NULL, true);
|
||||||
fOwner->SetPreferredHandler(NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2659,9 +2659,6 @@ BWindow::_SetFocus(BView *focusView, bool notifyInputServer)
|
|||||||
if (fFocus == focusView)
|
if (fFocus == focusView)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (focusView)
|
|
||||||
focusView->MakeFocus(true);
|
|
||||||
|
|
||||||
// we notify the input server if we are passing focus
|
// we notify the input server if we are passing focus
|
||||||
// from a view which has the B_INPUT_METHOD_AWARE to a one
|
// from a view which has the B_INPUT_METHOD_AWARE to a one
|
||||||
// which does not, or vice-versa
|
// which does not, or vice-versa
|
||||||
@ -2669,17 +2666,16 @@ BWindow::_SetFocus(BView *focusView, bool notifyInputServer)
|
|||||||
bool oldIMAware = false, newIMAware = false;
|
bool oldIMAware = false, newIMAware = false;
|
||||||
if (focusView)
|
if (focusView)
|
||||||
newIMAware = focusView->Flags() & B_INPUT_METHOD_AWARE;
|
newIMAware = focusView->Flags() & B_INPUT_METHOD_AWARE;
|
||||||
if (fFocus)
|
BMessage msg(newIMAware ? IS_FOCUS_IM_AWARE_VIEW : IS_UNFOCUS_IM_AWARE_VIEW);
|
||||||
oldIMAware = fFocus->Flags() & B_INPUT_METHOD_AWARE;
|
BMessenger messenger(focusView);
|
||||||
if (newIMAware ^ oldIMAware) {
|
BMessage reply;
|
||||||
BMessage msg(newIMAware ? IS_FOCUS_IM_AWARE_VIEW : IS_UNFOCUS_IM_AWARE_VIEW);
|
if (focusView)
|
||||||
BMessage reply;
|
msg.AddMessenger("view", messenger);
|
||||||
_control_input_server_(&msg, &reply);
|
_control_input_server_(&msg, &reply);
|
||||||
// do we care return code ?
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fFocus = focusView;
|
fFocus = focusView;
|
||||||
|
SetPreferredHandler(focusView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3014,8 +3010,9 @@ BWindow::_KeyboardNavigation()
|
|||||||
else
|
else
|
||||||
nextFocus = _FindNextNavigable(fFocus, jumpGroups);
|
nextFocus = _FindNextNavigable(fFocus, jumpGroups);
|
||||||
|
|
||||||
if (nextFocus && nextFocus != fFocus)
|
if (nextFocus && nextFocus != fFocus) {
|
||||||
_SetFocus(nextFocus, false);
|
nextFocus->MakeFocus(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user