BWindow::IsFront() was implemented incorrectly - we actually need to query the

app_server for this; added a new AS_IS_FRONT_WINDOW command for this.
For example, clicking on the menu bar to bring windows to front in FFM mode
does work now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19725 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-01-06 17:08:19 +00:00
parent f0d2e76081
commit ccf137b886
3 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku.
* Copyright 2001-2007, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -92,6 +92,7 @@ enum {
AS_WINDOW_MOVE,
AS_SET_SIZE_LIMITS,
AS_ACTIVATE_WINDOW,
AS_IS_FRONT_WINDOW,
AS_UPDATE_IF_NEEDED,
// BPicture definitions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku.
* Copyright 2001-2007, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -647,7 +647,17 @@ BWindow::EndViewTransaction()
bool
BWindow::IsFront() const
{
return (IsActive() || IsModal());
BAutolock locker(const_cast<BWindow*>(this));
if (!locker.IsLocked())
return false;
fLink->StartMessage(AS_IS_FRONT_WINDOW);
status_t status;
if (fLink->FlushWithReply(status) == B_OK)
return status >= B_OK;
return false;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku.
* Copyright 2001-2007, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -813,6 +813,11 @@ fDesktop->LockSingleWindow();
break;
}
#endif
case AS_IS_FRONT_WINDOW:
fLink.StartMessage(fDesktop->FrontWindow() == fWindowLayer ? B_OK : B_ERROR);
fLink.Flush();
break;
case AS_GET_WORKSPACES:
{
STRACE(("ServerWindow %s: Message AS_GET_WORKSPACES\n", Title()));