* Added proper locking to _ResizeToFullScreen().

* Desktop::{Move|Resize}WindowBy() could be called with zeros in which case it
  doesn't have to do anything.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32775 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-08-28 09:33:18 +00:00
parent e5c25980bd
commit 2a0cda5017
2 changed files with 15 additions and 7 deletions
+6
View File
@@ -1099,6 +1099,9 @@ Desktop::HideWindow(Window* window)
void
Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
{
if (x == 0 && y == 0)
return;
if (!LockAllWindows())
return;
@@ -1173,6 +1176,9 @@ Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
void
Desktop::ResizeWindowBy(Window* window, float x, float y)
{
if (x == 0 && y == 0)
return;
if (!LockAllWindows())
return;
+9 -7
View File
@@ -3561,13 +3561,16 @@ ServerWindow::_MessageNeedsAllWindowsLocked(uint32 code) const
void
ServerWindow::_ResizeToFullScreen()
{
const Screen *screen = fWindow->Screen();
if (screen == NULL) {
return;
// the window isn't yet attached to a screen
}
BRect screenFrame;
BRect screenFrame = screen->Frame();
{
AutoReadLocker _(fDesktop->ScreenLocker());
const Screen* screen = fWindow->Screen();
if (screen == NULL)
return;
screenFrame = fWindow->Screen()->Frame();
}
fDesktop->MoveWindowBy(fWindow,
screenFrame.left - fWindow->Frame().left,
@@ -3611,7 +3614,6 @@ ServerWindow::_DirectWindowSetFullScreen(bool enable)
fDesktop->HWInterface()->SetCursorVisible(false);
fDirectWindowInfo->EnableFullScreen(fWindow->Frame(), fWindow->Feel());
_ResizeToFullScreen();
} else {
const BRect& originalFrame = fDirectWindowInfo->OriginalFrame();