Implemented Enable/DisableUpdates again on the app_server side. Untested. It

should prevent the app_server to send any update messages to the client. It
should just keep adding to the pending update sessions region until the client
enabled updates again. If anything is already in the pending session, an
update request will be send immediately.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24029 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-02-20 00:56:45 +00:00
parent b582e0a75e
commit d755e1c073
3 changed files with 19 additions and 11 deletions

View File

@ -705,16 +705,14 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
{
STRACE(("ServerWindow %s: Message AS_ENABLE_UPDATES unimplemented\n",
Title()));
// TODO: AS_ENABLE_UPDATES
//fWindowLayer->EnableUpdateRequests();
fWindowLayer->EnableUpdateRequests();
break;
}
case AS_DISABLE_UPDATES:
{
STRACE(("ServerWindow %s: Message AS_DISABLE_UPDATES unimplemented\n",
Title()));
// TODO: AS_DISABLE_UPDATES
//fWindowLayer->DisableUpdateRequests();
fWindowLayer->DisableUpdateRequests();
break;
}
case AS_NEEDS_UPDATE:

View File

@ -111,6 +111,7 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
fPendingUpdateSession(&fUpdateSessions[1]),
fUpdateRequested(false),
fInUpdate(false),
fUpdatesEnabled(true),
// windows start hidden
fHidden(true),
@ -701,18 +702,23 @@ WindowLayer::InvalidateView(ViewLayer* layer, BRegion& layerRegion)
}
}
// DisableUpdateRequests
void
WindowLayer::DisableUpdateRequests()
{
fUpdatesEnabled = false;
}
// EnableUpdateRequests
void
WindowLayer::EnableUpdateRequests()
{
// fUpdateRequestsEnabled = true;
/* if (fCumulativeRegion.CountRects() > 0) {
GetRootLayer()->MarkForRedraw(fCumulativeRegion);
GetRootLayer()->TriggerRedraw();
}*/
fUpdatesEnabled = true;
if (!fUpdateRequested && fPendingUpdateSession->IsUsed())
_SendUpdateMessage();
}
// #pragma mark -
@ -1814,6 +1820,9 @@ WindowLayer::_TransferToUpdateSession(BRegion* contentDirtyRegion)
void
WindowLayer::_SendUpdateMessage()
{
if (!fUpdatesEnabled)
return;
BMessage message(_UPDATE_);
ServerWindow()->SendMessageToClient(&message);

View File

@ -104,8 +104,8 @@ class WindowLayer {
// shortcut for invalidating just one view
void InvalidateView(ViewLayer* view, BRegion& layerRegion);
void EnableUpdateRequests();
void DisableUpdateRequests();
void EnableUpdateRequests();
void BeginUpdate(BPrivate::PortLink& link);
void EndUpdate();
@ -335,6 +335,7 @@ class WindowLayer {
// and consistent update session
bool fUpdateRequested : 1;
bool fInUpdate : 1;
bool fUpdatesEnabled : 1;
bool fHidden : 1;
bool fMinimized : 1;