* 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
|
void
|
||||||
Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
|
Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
|
||||||
{
|
{
|
||||||
|
if (x == 0 && y == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!LockAllWindows())
|
if (!LockAllWindows())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1173,6 +1176,9 @@ Desktop::MoveWindowBy(Window* window, float x, float y, int32 workspace)
|
|||||||
void
|
void
|
||||||
Desktop::ResizeWindowBy(Window* window, float x, float y)
|
Desktop::ResizeWindowBy(Window* window, float x, float y)
|
||||||
{
|
{
|
||||||
|
if (x == 0 && y == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!LockAllWindows())
|
if (!LockAllWindows())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -3561,13 +3561,16 @@ ServerWindow::_MessageNeedsAllWindowsLocked(uint32 code) const
|
|||||||
void
|
void
|
||||||
ServerWindow::_ResizeToFullScreen()
|
ServerWindow::_ResizeToFullScreen()
|
||||||
{
|
{
|
||||||
const Screen *screen = fWindow->Screen();
|
BRect screenFrame;
|
||||||
if (screen == NULL) {
|
|
||||||
return;
|
|
||||||
// the window isn't yet attached to a screen
|
|
||||||
}
|
|
||||||
|
|
||||||
BRect screenFrame = screen->Frame();
|
{
|
||||||
|
AutoReadLocker _(fDesktop->ScreenLocker());
|
||||||
|
const Screen* screen = fWindow->Screen();
|
||||||
|
if (screen == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
screenFrame = fWindow->Screen()->Frame();
|
||||||
|
}
|
||||||
|
|
||||||
fDesktop->MoveWindowBy(fWindow,
|
fDesktop->MoveWindowBy(fWindow,
|
||||||
screenFrame.left - fWindow->Frame().left,
|
screenFrame.left - fWindow->Frame().left,
|
||||||
@@ -3611,7 +3614,6 @@ ServerWindow::_DirectWindowSetFullScreen(bool enable)
|
|||||||
fDesktop->HWInterface()->SetCursorVisible(false);
|
fDesktop->HWInterface()->SetCursorVisible(false);
|
||||||
|
|
||||||
fDirectWindowInfo->EnableFullScreen(fWindow->Frame(), fWindow->Feel());
|
fDirectWindowInfo->EnableFullScreen(fWindow->Frame(), fWindow->Feel());
|
||||||
|
|
||||||
_ResizeToFullScreen();
|
_ResizeToFullScreen();
|
||||||
} else {
|
} else {
|
||||||
const BRect& originalFrame = fDirectWindowInfo->OriginalFrame();
|
const BRect& originalFrame = fDirectWindowInfo->OriginalFrame();
|
||||||
|
|||||||
Reference in New Issue
Block a user