Implemented B_AVOID_FOCUS support.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15262 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-12-01 12:31:05 +00:00
parent 85096c8acb
commit 5d32708515
2 changed files with 8 additions and 3 deletions

View File

@ -165,9 +165,14 @@ RootLayer::_SetFocus(WindowLayer* focus, BRegion& update)
{
// TODO: test for FFM and B_LOCK_WINDOW_FOCUS
if (focus == fFocus)
if (focus == fFocus && (focus->WindowFlags() & B_AVOID_FOCUS) == 0)
return true;
// make sure no window is chosen that doesn't want focus
while (focus != NULL && (focus->WindowFlags() & B_AVOID_FOCUS) != 0) {
focus = (WindowLayer*)focus->PreviousLayer();
}
if (fFocus != NULL) {
update.Include(&fFocus->VisibleRegion());
fFocus->SetFocus(false);
@ -507,7 +512,7 @@ RootLayer::ShowWindowLayer(WindowLayer* windowLayer, bool toFront)
// TODO: if this window has any floating windows, remove them here
// TODO: support FFM and B_AVOID_FOCUS
// TODO: support FFM
if (Front() == windowLayer || Focus() == NULL)
_SetFocus(windowLayer, changed);
_WindowsChanged(changed);

View File

@ -462,7 +462,7 @@ WindowLayer::MouseDown(BMessage *msg, BPoint where, int32* _viewToken)
if (desktopSettings.MouseMode() == B_NORMAL_MOUSE)
desktop->ActivateWindow(this);
if ((WindowFlags() & B_WILL_ACCEPT_FIRST_CLICK) == 0)
if ((WindowFlags() & (B_WILL_ACCEPT_FIRST_CLICK | B_AVOID_FOCUS)) == 0)
return;
}