* 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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user