* _Show() and _Hide() must now be called with having all windows locked

(it would do that internally anyway).
* AS_MINIMIZE no longer calls _Show() when being unminimized, but
  Desktop::ActivateWindow(), as this will also bring the window on the screen
  if it's on another workspace (according to its flags).
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28168 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-10-16 12:15:02 +00:00
parent 9f1cce99b9
commit 96c6ee9507
+15 -14
View File
@@ -348,7 +348,9 @@ ServerWindow::ReplaceDecorator()
}
//! Shows the window's Window
/*! Shows the window's Window. You need to have all windows locked when
calling this function.
*/
void
ServerWindow::_Show()
{
@@ -358,18 +360,16 @@ ServerWindow::_Show()
if (fQuitting || !fWindow->IsHidden() || fWindow->IsOffscreenWindow())
return;
// TODO: Maybe we need to dispatch a message to the desktop to show/hide us
// instead of doing it from this thread.
fDesktop->UnlockSingleWindow();
fDesktop->ShowWindow(fWindow);
fDesktop->LockSingleWindow();
if (fDirectWindowData != NULL)
HandleDirectConnection(B_DIRECT_START | B_BUFFER_RESET);
}
//! Hides the window's Window
/*! Hides the window's Window. You need to have all windows locked when
calling this function.
*/
void
ServerWindow::_Hide()
{
@@ -382,9 +382,7 @@ ServerWindow::_Hide()
if (fDirectWindowData != NULL)
HandleDirectConnection(B_DIRECT_STOP);
fDesktop->UnlockSingleWindow();
fDesktop->HideWindow(fWindow);
fDesktop->LockSingleWindow();
}
@@ -648,12 +646,14 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
break;
}
if (minimize && !fWindow->IsHidden())
if (minimize && !fWindow->IsHidden()) {
_Hide();
else if (!minimize && fWindow->IsHidden())
_Show();
fWindow->SetMinimized(minimize);
} else if (!minimize && fWindow->IsHidden()) {
fDesktop->ActivateWindow(fWindow);
// this will unminimize the window for us
}
fWindow->SetMinimized(minimize);
}
break;
}
@@ -665,12 +665,10 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<bool>(&activate);
//fDesktop->UnlockSingleWindow();
if (activate)
fDesktop->ActivateWindow(fWindow);
else
fDesktop->SendWindowBehind(fWindow, NULL);
//fDesktop->LockSingleWindow();
break;
}
case AS_SEND_BEHIND:
@@ -3431,7 +3429,10 @@ bool
ServerWindow::_MessageNeedsAllWindowsLocked(uint32 code) const
{
switch (code) {
case AS_SHOW_WINDOW:
case AS_HIDE_WINDOW:
case AS_ACTIVATE_WINDOW:
case AS_MINIMIZE_WINDOW:
case AS_SET_WINDOW_TITLE:
case AS_ADD_TO_SUBSET:
case AS_REMOVE_FROM_SUBSET: