* _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 void
ServerWindow::_Show() ServerWindow::_Show()
{ {
@@ -358,18 +360,16 @@ ServerWindow::_Show()
if (fQuitting || !fWindow->IsHidden() || fWindow->IsOffscreenWindow()) if (fQuitting || !fWindow->IsHidden() || fWindow->IsOffscreenWindow())
return; 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->ShowWindow(fWindow);
fDesktop->LockSingleWindow();
if (fDirectWindowData != NULL) if (fDirectWindowData != NULL)
HandleDirectConnection(B_DIRECT_START | B_BUFFER_RESET); 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 void
ServerWindow::_Hide() ServerWindow::_Hide()
{ {
@@ -382,9 +382,7 @@ ServerWindow::_Hide()
if (fDirectWindowData != NULL) if (fDirectWindowData != NULL)
HandleDirectConnection(B_DIRECT_STOP); HandleDirectConnection(B_DIRECT_STOP);
fDesktop->UnlockSingleWindow();
fDesktop->HideWindow(fWindow); fDesktop->HideWindow(fWindow);
fDesktop->LockSingleWindow();
} }
@@ -648,12 +646,14 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
break; break;
} }
if (minimize && !fWindow->IsHidden()) if (minimize && !fWindow->IsHidden()) {
_Hide(); _Hide();
else if (!minimize && fWindow->IsHidden())
_Show();
fWindow->SetMinimized(minimize); fWindow->SetMinimized(minimize);
} else if (!minimize && fWindow->IsHidden()) {
fDesktop->ActivateWindow(fWindow);
// this will unminimize the window for us
}
} }
break; break;
} }
@@ -665,12 +665,10 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<bool>(&activate); link.Read<bool>(&activate);
//fDesktop->UnlockSingleWindow();
if (activate) if (activate)
fDesktop->ActivateWindow(fWindow); fDesktop->ActivateWindow(fWindow);
else else
fDesktop->SendWindowBehind(fWindow, NULL); fDesktop->SendWindowBehind(fWindow, NULL);
//fDesktop->LockSingleWindow();
break; break;
} }
case AS_SEND_BEHIND: case AS_SEND_BEHIND:
@@ -3431,7 +3429,10 @@ bool
ServerWindow::_MessageNeedsAllWindowsLocked(uint32 code) const ServerWindow::_MessageNeedsAllWindowsLocked(uint32 code) const
{ {
switch (code) { switch (code) {
case AS_SHOW_WINDOW:
case AS_HIDE_WINDOW:
case AS_ACTIVATE_WINDOW: case AS_ACTIVATE_WINDOW:
case AS_MINIMIZE_WINDOW:
case AS_SET_WINDOW_TITLE: case AS_SET_WINDOW_TITLE:
case AS_ADD_TO_SUBSET: case AS_ADD_TO_SUBSET:
case AS_REMOVE_FROM_SUBSET: case AS_REMOVE_FROM_SUBSET: