diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 617431a5dc..90e07ccfc1 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -272,11 +272,8 @@ ServerWindow::Show() rootLayer->Unlock(); } - // TODO: This doesn't work: Here we aren't shown yet as RootLayer::ShowWinBorder() - // does its work asynchronously. As we lock the rootlayer, I think it could be synchronous. - // Otherwise, we need a "Shown()" hook or something like that. if (fDirectWindowData != NULL) - _HandleDirectConnection(B_DIRECT_START); + _HandleDirectConnection(B_DIRECT_START|B_BUFFER_RESET); } @@ -2410,14 +2407,18 @@ ServerWindow::_EnableDirectWindowMode() void -ServerWindow::_HandleDirectConnection(direct_buffer_state state) +ServerWindow::_HandleDirectConnection(int bufferState, int driverState) { if (fDirectWindowData == NULL) return; - fDirectWindowData->direct_info->buffer_state = state; + if (bufferState != -1) + fDirectWindowData->direct_info->buffer_state = (direct_buffer_state)bufferState; - if ((state & B_DIRECT_MODE_MASK) != B_DIRECT_STOP) { + if (driverState != -1) + fDirectWindowData->direct_info->driver_state = (direct_driver_state)driverState; + + if ((bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_STOP) { // TODO: Locking ? RenderingBuffer *buffer = fDesktop->GetHWInterface()->FrontBuffer(); fDirectWindowData->direct_info->bits = buffer->Bits(); diff --git a/src/servers/app/ServerWindow.h b/src/servers/app/ServerWindow.h index a0b41485f7..df847a213a 100644 --- a/src/servers/app/ServerWindow.h +++ b/src/servers/app/ServerWindow.h @@ -13,7 +13,6 @@ #define _SERVERWIN_H_ -#include // for direct_buffer_state #include #include #include @@ -119,7 +118,7 @@ private: virtual void _GetLooperName(char* name, size_t size); status_t _EnableDirectWindowMode(); - void _HandleDirectConnection(direct_buffer_state state); + void _HandleDirectConnection(int bufferState = -1, int driverState = -1); // TODO: Move me elsewhere status_t PictureToRegion(ServerPicture *picture,