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:
Stefano Ceccherini
2009-08-17 11:53:50 +00:00
parent 219bd33f29
commit a1bcb09b45
3 changed files with 23 additions and 1 deletions
+1
View File
@@ -1147,6 +1147,7 @@ Desktop::ScreenChanged(Screen* screen, bool makeDefault)
// TODO: currently ignores the screen argument!
for (Window* window = fAllWindows.FirstWindow(); window != NULL;
window = window->NextWindow(kAllWindowList)) {
window->ServerWindow()->ScreenChanged(&update);
window->ServerWindow()->SendMessageToClient(&update);
}
+21 -1
View File
@@ -153,7 +153,7 @@ public:
BRect old_window_frame;
direct_buffer_info *buffer_info;
bool full_screen;
private:
sem_id fSem;
sem_id fAcknowledgeSem;
@@ -165,6 +165,7 @@ private:
DirectWindowData::DirectWindowData()
:
buffer_info(NULL),
full_screen(false),
fSem(-1),
fAcknowledgeSem(-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
ServerWindow::SendMessageToClient(const BMessage* msg, int32 target) const
{
@@ -3788,6 +3807,7 @@ ServerWindow::_DirectWindowSetFullScreen(bool enable)
fDesktop->HWInterface()->SetCursorVisible(true);
}
fDirectWindowData->full_screen = enable;
fDesktop->SetWindowFeel(fWindow,
enable ? kWindowScreenFeel : fDirectWindowFeel);
}
+1
View File
@@ -72,6 +72,7 @@ public:
const BMessenger& HandlerMessenger() const
{ return fHandlerMessenger; }
void ScreenChanged(const BMessage *screenChangedMessage);
status_t SendMessageToClient(const BMessage* msg,
int32 target = B_NULL_TOKEN) const;