Added a ServerWindow::ScreenChanged() hook, which takes care of resizing
an eventual offscreen directwindow and sends the direct window notifications (not yet, though, since a BDirectWindow on a non-visible workspace would get the B_DIRECT_START notification and start drawing on a different workspace). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32455 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1147,6 +1147,7 @@ Desktop::ScreenChanged(Screen* screen, bool makeDefault)
|
|||||||
// TODO: currently ignores the screen argument!
|
// TODO: currently ignores the screen argument!
|
||||||
for (Window* window = fAllWindows.FirstWindow(); window != NULL;
|
for (Window* window = fAllWindows.FirstWindow(); window != NULL;
|
||||||
window = window->NextWindow(kAllWindowList)) {
|
window = window->NextWindow(kAllWindowList)) {
|
||||||
|
window->ServerWindow()->ScreenChanged(&update);
|
||||||
window->ServerWindow()->SendMessageToClient(&update);
|
window->ServerWindow()->SendMessageToClient(&update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public:
|
|||||||
|
|
||||||
BRect old_window_frame;
|
BRect old_window_frame;
|
||||||
direct_buffer_info *buffer_info;
|
direct_buffer_info *buffer_info;
|
||||||
|
bool full_screen;
|
||||||
private:
|
private:
|
||||||
sem_id fSem;
|
sem_id fSem;
|
||||||
sem_id fAcknowledgeSem;
|
sem_id fAcknowledgeSem;
|
||||||
@@ -165,6 +165,7 @@ private:
|
|||||||
DirectWindowData::DirectWindowData()
|
DirectWindowData::DirectWindowData()
|
||||||
:
|
:
|
||||||
buffer_info(NULL),
|
buffer_info(NULL),
|
||||||
|
full_screen(false),
|
||||||
fSem(-1),
|
fSem(-1),
|
||||||
fAcknowledgeSem(-1),
|
fAcknowledgeSem(-1),
|
||||||
fBufferArea(-1),
|
fBufferArea(-1),
|
||||||
@@ -3537,6 +3538,24 @@ ServerWindow::_MessageLooper()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ServerWindow::ScreenChanged(const BMessage *message)
|
||||||
|
{
|
||||||
|
// TODO: execute the stop notification earlier
|
||||||
|
//HandleDirectConnection(B_DIRECT_STOP);
|
||||||
|
SendMessageToClient(message);
|
||||||
|
if (fDirectWindowData != NULL && fDirectWindowData->full_screen) {
|
||||||
|
BRect screenFrame = fDesktop->ActiveScreen()->Frame();
|
||||||
|
fDesktop->ResizeWindowBy(fWindow,
|
||||||
|
screenFrame.Width() - fWindow->Frame().Width(),
|
||||||
|
screenFrame.Height() - fWindow->Frame().Height());
|
||||||
|
}
|
||||||
|
|
||||||
|
//HandleDirectConnection(B_DIRECT_START | B_BUFFER_RESET,
|
||||||
|
//B_SCREEN_CHANGED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ServerWindow::SendMessageToClient(const BMessage* msg, int32 target) const
|
ServerWindow::SendMessageToClient(const BMessage* msg, int32 target) const
|
||||||
{
|
{
|
||||||
@@ -3788,6 +3807,7 @@ ServerWindow::_DirectWindowSetFullScreen(bool enable)
|
|||||||
fDesktop->HWInterface()->SetCursorVisible(true);
|
fDesktop->HWInterface()->SetCursorVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fDirectWindowData->full_screen = enable;
|
||||||
fDesktop->SetWindowFeel(fWindow,
|
fDesktop->SetWindowFeel(fWindow,
|
||||||
enable ? kWindowScreenFeel : fDirectWindowFeel);
|
enable ? kWindowScreenFeel : fDirectWindowFeel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public:
|
|||||||
const BMessenger& HandlerMessenger() const
|
const BMessenger& HandlerMessenger() const
|
||||||
{ return fHandlerMessenger; }
|
{ return fHandlerMessenger; }
|
||||||
|
|
||||||
|
void ScreenChanged(const BMessage *screenChangedMessage);
|
||||||
status_t SendMessageToClient(const BMessage* msg,
|
status_t SendMessageToClient(const BMessage* msg,
|
||||||
int32 target = B_NULL_TOKEN) const;
|
int32 target = B_NULL_TOKEN) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user