* Since ServerWindow::Window() can also be NULL in case the window hadn't been
added to the Desktop yet, we better make sure in AS_GET_SCREEN_ID_FROM_WINDOW that this is not the case. * Removed the now superfluous ServerWindow::IsOffscreen() again. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32653 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2264,11 +2264,15 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
||||
|
||||
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
|
||||
ServerWindow* window = fWindowList.ItemAt(i);
|
||||
|
||||
|
||||
if (window->ClientToken() == clientToken) {
|
||||
// found it!
|
||||
if (window->IsOffscreen())
|
||||
if (window->Window() == NULL) {
|
||||
// The window hasn't been added to the desktop yet,
|
||||
// or it's an offscreen window
|
||||
break;
|
||||
}
|
||||
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<int32>(window->Window()->Screen()->ID());
|
||||
status = B_OK;
|
||||
|
||||
@@ -285,6 +285,23 @@ ServerWindow::Init(BRect frame, window_look look, window_feel feel,
|
||||
}
|
||||
|
||||
|
||||
/*! Returns the ServerWindow's Window, if it exists and has been
|
||||
added to the Desktop already.
|
||||
In other words, you cannot assume this method will always give you
|
||||
a valid pointer.
|
||||
*/
|
||||
Window*
|
||||
ServerWindow::Window() const
|
||||
{
|
||||
ASSERT_MULTI_LOCKED(fDesktop->WindowLocker());
|
||||
|
||||
if (!fWindowAddedToDesktop)
|
||||
return NULL;
|
||||
|
||||
return fWindow;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ServerWindow::_PrepareQuit()
|
||||
{
|
||||
@@ -472,32 +489,6 @@ ServerWindow::ResyncDrawState()
|
||||
}
|
||||
|
||||
|
||||
/*! Returns the ServerWindow's Window, if it exists and has been
|
||||
added to the Desktop already.
|
||||
In other words, you cannot assume this method will always give you
|
||||
a valid pointer.
|
||||
*/
|
||||
Window*
|
||||
ServerWindow::Window() const
|
||||
{
|
||||
// TODO: ensure desktop is locked!
|
||||
if (!fWindowAddedToDesktop)
|
||||
return NULL;
|
||||
|
||||
return fWindow;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ServerWindow::IsOffscreen() const
|
||||
{
|
||||
// TODO: ensure desktop is locked!
|
||||
// TODO: ensure the Window has been created!
|
||||
|
||||
return fWindow->IsOffscreenWindow();
|
||||
}
|
||||
|
||||
|
||||
View*
|
||||
ServerWindow::_CreateView(BPrivate::LinkReceiver& link, View** _parent)
|
||||
{
|
||||
@@ -3489,14 +3480,14 @@ ServerWindow::HandleDirectConnection(int32 bufferState, int32 driverState)
|
||||
(direct_driver_state)driverState,
|
||||
fDesktop->HWInterface()->FrontBuffer(), fWindow->Frame(),
|
||||
fWindow->VisibleContentRegion());
|
||||
|
||||
|
||||
if (status != B_OK) {
|
||||
char errorString[256];
|
||||
snprintf(errorString, sizeof(errorString),
|
||||
"%s killed for a problem in DirectConnected(): %s",
|
||||
App()->Signature(), strerror(status));
|
||||
syslog(LOG_ERR, errorString);
|
||||
|
||||
|
||||
// The client application didn't release the semaphore
|
||||
// within the given timeout. Or something else went wrong.
|
||||
// Deleting this member should make it crash.
|
||||
|
||||
@@ -57,10 +57,15 @@ public:
|
||||
status_t Init(BRect frame, window_look look,
|
||||
window_feel feel, uint32 flags,
|
||||
uint32 workspace);
|
||||
|
||||
virtual port_id MessagePort() const { return fMessagePort; }
|
||||
|
||||
::EventTarget& EventTarget() { return fEventTarget; }
|
||||
|
||||
inline ServerApp* App() const { return fServerApp; }
|
||||
::Desktop* Desktop() const { return fDesktop; }
|
||||
::Window* Window() const;
|
||||
|
||||
// methods for sending various messages to client.
|
||||
void NotifyQuitRequested();
|
||||
void NotifyMinimize(bool minimize);
|
||||
@@ -80,12 +85,6 @@ public:
|
||||
window_look look, window_feel feel,
|
||||
uint32 flags, uint32 workspace);
|
||||
|
||||
// to who we belong. who do we own. our title.
|
||||
inline ServerApp* App() const { return fServerApp; }
|
||||
::Desktop* Desktop() const { return fDesktop; }
|
||||
::Window* Window() const;
|
||||
bool IsOffscreen() const;
|
||||
|
||||
void SetTitle(const char* newTitle);
|
||||
inline const char* Title() const { return fTitle; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user