diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 274e2962ca..ca0a09864f 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -205,26 +205,6 @@ ServerApp::InitCheck() } -/*! - \brief Starts the ServerApp monitoring for messages - \return false if the application couldn't start, true if everything went OK. -*/ -bool -ServerApp::Run() -{ - if (!MessageLooper::Run()) - return false; - - // Let's tell the client how to talk with us - fLink.StartMessage(B_OK); - fLink.Attach(fMessagePort); - fLink.Attach(fDesktop->SharedReadOnlyArea()); - fLink.Flush(); - - return true; -} - - /*! \brief This quits the application and deletes it. You're not supposed to call its destructor directly. @@ -340,6 +320,12 @@ ServerApp::_MessageLooper() { // Message-dispatching loop for the ServerApp + // First let's tell the client how to talk with us. + fLink.StartMessage(B_OK); + fLink.Attach(fMessagePort); + fLink.Attach(fDesktop->SharedReadOnlyArea()); + fLink.Flush(); + BPrivate::LinkReceiver &receiver = fLink.Receiver(); int32 code; diff --git a/src/servers/app/ServerApp.h b/src/servers/app/ServerApp.h index ec86f8fd08..8945ee0189 100644 --- a/src/servers/app/ServerApp.h +++ b/src/servers/app/ServerApp.h @@ -50,7 +50,6 @@ class ServerApp : public MessageLooper { status_t InitCheck(); void Quit(sem_id shutdownSemaphore = -1); - virtual bool Run(); virtual port_id MessagePort() const { return fMessagePort; } /*! diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 44417ba303..1adea2f396 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -297,32 +297,6 @@ ServerWindow::Init(BRect frame, window_look look, window_feel feel, } -bool -ServerWindow::Run() -{ - if (!MessageLooper::Run()) - return false; - - // Send a reply to our window - it is expecting fMessagePort - // port and some other info - - fLink.StartMessage(B_OK); - fLink.Attach(fMessagePort); - - int32 minWidth, maxWidth, minHeight, maxHeight; - fWindow->GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight); - - fLink.Attach(fWindow->Frame()); - fLink.Attach((float)minWidth); - fLink.Attach((float)maxWidth); - fLink.Attach((float)minHeight); - fLink.Attach((float)maxHeight); - fLink.Flush(); - - return true; -} - - void ServerWindow::_PrepareQuit() { @@ -2844,6 +2818,22 @@ ServerWindow::_DispatchPictureMessage(int32 code, BPrivate::LinkReceiver &link) void ServerWindow::_MessageLooper() { + // Send a reply to our window - it is expecting fMessagePort + // port and some other info. + + fLink.StartMessage(B_OK); + fLink.Attach(fMessagePort); + + int32 minWidth, maxWidth, minHeight, maxHeight; + fWindow->GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight); + + fLink.Attach(fWindow->Frame()); + fLink.Attach((float)minWidth); + fLink.Attach((float)maxWidth); + fLink.Attach((float)minHeight); + fLink.Attach((float)maxHeight); + fLink.Flush(); + BPrivate::LinkReceiver& receiver = fLink.Receiver(); bool quitLoop = false; diff --git a/src/servers/app/ServerWindow.h b/src/servers/app/ServerWindow.h index 845d7252e6..d81f19da55 100644 --- a/src/servers/app/ServerWindow.h +++ b/src/servers/app/ServerWindow.h @@ -57,7 +57,6 @@ public: status_t Init(BRect frame, window_look look, window_feel feel, uint32 flags, uint32 workspace); - virtual bool Run(); virtual port_id MessagePort() const { return fMessagePort; } ::EventTarget& EventTarget() { return fEventTarget; }