This may be a quick and dirty fix to the problems we've been having with the update code. However this requires something from DisplayDriver. I'll write about this in a moment on app_server list.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -262,6 +262,7 @@ void Desktop::AddWinBorder(WinBorder *winBorder)
|
|||||||
if (fWinBorderList.HasItem(winBorder))
|
if (fWinBorderList.HasItem(winBorder))
|
||||||
{
|
{
|
||||||
Unlock();
|
Unlock();
|
||||||
|
ActiveRootLayer()->Unlock();
|
||||||
debugger("AddWinBorder: WinBorder already in Desktop list\n");
|
debugger("AddWinBorder: WinBorder already in Desktop list\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -356,6 +357,7 @@ void Desktop::RemoveWinBorder(WinBorder *winBorder)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Unlock();
|
Unlock();
|
||||||
|
ActiveRootLayer()->Unlock();
|
||||||
debugger("RemoveWinBorder: WinBorder not found in Desktop list\n");
|
debugger("RemoveWinBorder: WinBorder not found in Desktop list\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-12
@@ -589,7 +589,12 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom)
|
|||||||
{
|
{
|
||||||
// server drawings are immediate.
|
// server drawings are immediate.
|
||||||
// No IPC is needed so this is done in place.
|
// No IPC is needed so this is done in place.
|
||||||
|
if (fClassID == AS_WINBORDER_CLASS)
|
||||||
|
{
|
||||||
|
WinBorder *wb = (WinBorder*)this;
|
||||||
|
wb->zUpdateReg.Include(®);
|
||||||
|
}
|
||||||
|
|
||||||
fUpdateReg = fVisible;
|
fUpdateReg = fVisible;
|
||||||
if (fFlags & B_FULL_UPDATE_ON_RESIZE
|
if (fFlags & B_FULL_UPDATE_ON_RESIZE
|
||||||
&& fFrameAction == B_LAYER_ACTION_RESIZE)
|
&& fFrameAction == B_LAYER_ACTION_RESIZE)
|
||||||
@@ -625,16 +630,7 @@ void Layer::RequestDraw(const BRegion ®, Layer *startFrom)
|
|||||||
common.IntersectWith(®);
|
common.IntersectWith(®);
|
||||||
|
|
||||||
if (common.CountRects() > 0)
|
if (common.CountRects() > 0)
|
||||||
{
|
|
||||||
// lock/unlock if we are a winborder
|
|
||||||
if (lay->fClassID == AS_WINBORDER_CLASS)
|
|
||||||
lay->Window()->Lock();
|
|
||||||
|
|
||||||
lay->RequestDraw(reg, NULL);
|
lay->RequestDraw(reg, NULL);
|
||||||
|
|
||||||
if (lay->fClassID == AS_WINBORDER_CLASS)
|
|
||||||
lay->Window()->Unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -659,15 +655,26 @@ void Layer::UpdateStart()
|
|||||||
{
|
{
|
||||||
// During updates we only want to draw what's in the update region
|
// During updates we only want to draw what's in the update region
|
||||||
fInUpdate = true;
|
fInUpdate = true;
|
||||||
|
if (fClassID == AS_WINBORDER_CLASS)
|
||||||
|
{
|
||||||
|
WinBorder *wb = (WinBorder*)this;
|
||||||
|
wb->yUpdateReg = wb->zUpdateReg;
|
||||||
|
wb->zUpdateReg.MakeEmpty();
|
||||||
|
}
|
||||||
fClipReg = &fUpdateReg;
|
fClipReg = &fUpdateReg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::UpdateEnd()
|
void Layer::UpdateEnd()
|
||||||
{
|
{
|
||||||
// The usual case. Drawing is permitted in the whole visible area.
|
// The usual case. Drawing is permitted in the whole visible area.
|
||||||
fInUpdate = false;
|
|
||||||
fClipReg = &fVisible;
|
|
||||||
fUpdateReg.MakeEmpty();
|
fUpdateReg.MakeEmpty();
|
||||||
|
if (fClassID == AS_WINBORDER_CLASS)
|
||||||
|
{
|
||||||
|
WinBorder *wb = (WinBorder*)this;
|
||||||
|
wb->yUpdateReg.MakeEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
fInUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ public:
|
|||||||
void GoRedraw(const Layer *layer, const BRegion ®ion);
|
void GoRedraw(const Layer *layer, const BRegion ®ion);
|
||||||
|
|
||||||
// Debug methods
|
// Debug methods
|
||||||
void PrintToStream(void);
|
void PrintToStream(void);
|
||||||
|
thread_id LockingThread() { return fAllRegionsLock.LockingThread(); }
|
||||||
|
|
||||||
BRegion fRedrawReg;
|
BRegion fRedrawReg;
|
||||||
BList fCopyRegList;
|
BList fCopyRegList;
|
||||||
|
|||||||
@@ -1408,7 +1408,9 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
case AS_BEGIN_UPDATE:
|
case AS_BEGIN_UPDATE:
|
||||||
{
|
{
|
||||||
DTRACE(("ServerWindowo %s: AS_BEGIN_UPDATE\n",fTitle.String()));
|
DTRACE(("ServerWindowo %s: AS_BEGIN_UPDATE\n",fTitle.String()));
|
||||||
|
fWinBorder->GetRootLayer()->Lock();
|
||||||
cl->UpdateStart();
|
cl->UpdateStart();
|
||||||
|
fWinBorder->GetRootLayer()->Unlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_END_UPDATE:
|
case AS_END_UPDATE:
|
||||||
@@ -1636,10 +1638,23 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
STRACE(("ServerWindow %s: Message Zoom unimplemented\n",fTitle.String()));
|
STRACE(("ServerWindow %s: Message Zoom unimplemented\n",fTitle.String()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
DispatchGraphicsMessage(code, link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// -------------------- Graphics messages ----------------------------------
|
// -------------------- Graphics messages ----------------------------------
|
||||||
|
void ServerWindow::DispatchGraphicsMessage(int32 code, LinkMsgReader &link)
|
||||||
|
{
|
||||||
|
fWinBorder->GetRootLayer()->Lock();
|
||||||
|
BRegion rreg(cl->fVisible);
|
||||||
|
rreg.Include(&fWinBorder->zUpdateReg);
|
||||||
|
|
||||||
|
desktop->GetDisplayDriver()->ConstrainClippingRegion(&rreg);
|
||||||
|
|
||||||
|
switch (code)
|
||||||
|
{
|
||||||
case AS_LAYER_SET_HIGH_COLOR:
|
case AS_LAYER_SET_HIGH_COLOR:
|
||||||
{
|
{
|
||||||
DTRACE(("ServerWindow %s: Message AS_LAYER_SET_HIGH_COLOR: Layer: %s\n",fTitle.String(), cl->fName->String()));
|
DTRACE(("ServerWindow %s: Message AS_LAYER_SET_HIGH_COLOR: Layer: %s\n",fTitle.String(), cl->fName->String()));
|
||||||
@@ -2222,6 +2237,9 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
desktop->GetDisplayDriver()->ConstrainClippingRegion(NULL);
|
||||||
|
fWinBorder->GetRootLayer()->Unlock();
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ private:
|
|||||||
|
|
||||||
// message handle methods.
|
// message handle methods.
|
||||||
void DispatchMessage(int32 code, LinkMsgReader &link);
|
void DispatchMessage(int32 code, LinkMsgReader &link);
|
||||||
|
void DispatchGraphicsMessage(int32 code, LinkMsgReader &link);
|
||||||
static int32 MonitorWin(void *data);
|
static int32 MonitorWin(void *data);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,9 @@ protected:
|
|||||||
Decorator *fDecorator;
|
Decorator *fDecorator;
|
||||||
Layer *fTopLayer;
|
Layer *fTopLayer;
|
||||||
|
|
||||||
|
BRegion zUpdateReg;
|
||||||
|
BRegion yUpdateReg;
|
||||||
|
|
||||||
int32 fMouseButtons;
|
int32 fMouseButtons;
|
||||||
int32 fKeyModifiers;
|
int32 fKeyModifiers;
|
||||||
BPoint fLastMousePosition;
|
BPoint fLastMousePosition;
|
||||||
|
|||||||
Reference in New Issue
Block a user