From 0c378a571401c3b0953796331ea12f75f638ee25 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 1 Nov 2005 09:53:47 +0000 Subject: [PATCH] Thanks to latest changes, BDirectWindow now draws something. Though, looks like either the clipping region is wrong, or the app_server overwrites what the BDirectWindow app writes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14610 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerWindow.cpp | 15 ++++++++------- src/servers/app/ServerWindow.h | 3 +-- 2 files changed, 9 insertions(+), 9 deletions(-) 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,