diff --git a/src/servers/app/DirectWindowSupport.cpp b/src/servers/app/DirectWindowSupport.cpp index a174b54784..61e93f5680 100644 --- a/src/servers/app/DirectWindowSupport.cpp +++ b/src/servers/app/DirectWindowSupport.cpp @@ -76,7 +76,7 @@ DirectWindowData::GetSyncData(direct_window_sync_data& data) const status_t -DirectWindowData::SyncronizeWithClient() +DirectWindowData::_SyncronizeWithClient() { // Releasing this semaphore causes the client to call // BDirectWindow::DirectConnected() @@ -94,7 +94,7 @@ DirectWindowData::SyncronizeWithClient() } -bool +status_t DirectWindowData::SetState(const direct_buffer_state& bufferState, const direct_driver_state& driverState, RenderingBuffer *buffer, const BRect& windowFrame, const BRegion& clipRegion) @@ -108,8 +108,10 @@ DirectWindowData::SetState(const direct_buffer_state& bufferState, bool isStopped = fTransition <= 0; - if (wasStopped && isStopped) - return false; + if (wasStopped && isStopped) { + // Nothing to change + return B_OK; + } buffer_info->buffer_state = bufferState; @@ -167,5 +169,5 @@ DirectWindowData::SetState(const direct_buffer_state& bufferState, buffer_info->clip_list[i] = clipRegion.RectAtInt(i); } - return true; + return _SyncronizeWithClient(); } diff --git a/src/servers/app/DirectWindowSupport.h b/src/servers/app/DirectWindowSupport.h index 1581112d2e..605339a516 100644 --- a/src/servers/app/DirectWindowSupport.h +++ b/src/servers/app/DirectWindowSupport.h @@ -43,7 +43,7 @@ public: direct_window_sync_data& data) const; status_t SyncronizeWithClient(); - bool SetState(const direct_buffer_state& bufferState, + status_t SetState(const direct_buffer_state& bufferState, const direct_driver_state& driverState, RenderingBuffer *renderingBuffer, const BRect& windowFrame, @@ -54,8 +54,7 @@ public: bool full_screen; private: - bool _HandleStop(const direct_buffer_state& state); - bool _HandleStart(const direct_buffer_state& state); + status_t _SyncronizeWithClient(); sem_id fSem; sem_id fAcknowledgeSem; diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index e6156b90f2..5d2c2cabda 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -3484,16 +3484,12 @@ ServerWindow::HandleDirectConnection(int32 bufferState, int32 driverState) return; if (fDesktop->LockSingleWindow()) { - if (!fDirectWindowData->SetState((direct_buffer_state)bufferState, - (direct_driver_state)driverState, - fDesktop->HWInterface()->FrontBuffer(), fWindow->Frame(), - fWindow->VisibleContentRegion())) { - fDesktop->UnlockSingleWindow(); - return; - } - - status_t status = fDirectWindowData->SyncronizeWithClient(); - + status_t status = fDirectWindowData->SetState( + (direct_buffer_state)bufferState, + (direct_driver_state)driverState, + fDesktop->HWInterface()->FrontBuffer(), fWindow->Frame(), + fWindow->VisibleContentRegion()); + if (status != B_OK) { char errorString[256]; snprintf(errorString, sizeof(errorString),