This fixes the update problems that I could observe. The client might have been not in sync with the server regarding window position and size, which in turn messed up the ConvertFromScreen() functions and also the view Bounds(). Therefor the current window geometry is also added to the information the client gets when starting an update session. I think the problem was there before my previous changes, just maybe less likely to be observed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16258 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6134fcc936
commit
95e29889f4
@ -776,11 +776,15 @@ BWindow::DispatchMessage(BMessage *msg, BHandler *target)
|
||||
MessageQueue()->RemoveMessage(pendingMessage);
|
||||
}
|
||||
}
|
||||
fFrame.right = fFrame.left + width;
|
||||
fFrame.bottom = fFrame.top + height;
|
||||
|
||||
_AdoptResize();
|
||||
FrameResized(width, height);
|
||||
if (width != fFrame.Width() || height != fFrame.Height()) {
|
||||
// NOTE: we might have already handled the resize
|
||||
// in an _UPDATE_ message
|
||||
fFrame.right = fFrame.left + width;
|
||||
fFrame.bottom = fFrame.top + height;
|
||||
|
||||
_AdoptResize();
|
||||
FrameResized(width, height);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -789,9 +793,13 @@ BWindow::DispatchMessage(BMessage *msg, BHandler *target)
|
||||
{
|
||||
BPoint origin;
|
||||
if (msg->FindPoint("where", &origin) == B_OK) {
|
||||
fFrame.OffsetTo(origin);
|
||||
if (fFrame.LeftTop() != origin) {
|
||||
// NOTE: we might have already handled the move
|
||||
// in an _UPDATE_ message
|
||||
fFrame.OffsetTo(origin);
|
||||
|
||||
FrameMoved(origin);
|
||||
FrameMoved(origin);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -953,7 +961,34 @@ BWindow::DispatchMessage(BMessage *msg, BHandler *target)
|
||||
int32 code;
|
||||
if (fLink->FlushWithReply(code) == B_OK
|
||||
&& code == B_OK) {
|
||||
// read culmulated update rect
|
||||
// read current window position and size first,
|
||||
// the update rect is in screen coordinates...
|
||||
// so we need to be up to date
|
||||
BPoint origin;
|
||||
fLink->Read<BPoint>(&origin);
|
||||
float width;
|
||||
float height;
|
||||
fLink->Read<float>(&width);
|
||||
fLink->Read<float>(&height);
|
||||
if (origin != fFrame.LeftTop()) {
|
||||
// TODO: remove code duplicatation with
|
||||
// B_WINDOW_MOVED case...
|
||||
//printf("window position was not up to date\n");
|
||||
fFrame.OffsetTo(origin);
|
||||
FrameMoved(origin);
|
||||
}
|
||||
if (width != fFrame.Width() || height != fFrame.Height()) {
|
||||
// TODO: remove code duplicatation with
|
||||
// B_WINDOW_RESIZED case...
|
||||
//printf("window size was not up to date\n");
|
||||
fFrame.right = fFrame.left + width;
|
||||
fFrame.bottom = fFrame.top + height;
|
||||
|
||||
_AdoptResize();
|
||||
FrameResized(width, height);
|
||||
}
|
||||
|
||||
// read culmulated update rect (is in screen coords)
|
||||
fLink->Read<BRect>(&updateRect);
|
||||
|
||||
// read tokens for views that need to be drawn
|
||||
|
@ -1596,7 +1596,7 @@ WindowLayer::_ShiftPartOfRegion(BRegion* region, BRegion* regionToShift,
|
||||
if (common.CountRects() > 0) {
|
||||
// cut the common part from the region,
|
||||
// offset that to destination and include again
|
||||
// region->Exclude(&common);
|
||||
region->Exclude(&common);
|
||||
common.OffsetBy(xOffset, yOffset);
|
||||
region->Include(&common);
|
||||
}
|
||||
@ -1751,10 +1751,18 @@ WindowLayer::BeginUpdate(BPrivate::PortLink& link)
|
||||
BRegion dirty(fCurrentUpdateSession.DirtyRegion());
|
||||
dirty.IntersectWith(&VisibleContentRegion());
|
||||
|
||||
//fDrawingEngine->FillRegion(dirty, RGBColor(255, 0, 0, 255));
|
||||
|
||||
link.StartMessage(B_OK);
|
||||
// append the current window geometry to the
|
||||
// message, the client will need it
|
||||
link.Attach<BPoint>(fFrame.LeftTop());
|
||||
link.Attach<float>(fFrame.Width());
|
||||
link.Attach<float>(fFrame.Height());
|
||||
// append he update rect in screen coords
|
||||
link.Attach<BRect>(dirty.Frame());
|
||||
// find and attach all views that intersect with
|
||||
// the dirty region
|
||||
link.StartMessage(B_OK);
|
||||
link.Attach<BRect>(dirty.Frame());
|
||||
fTopLayer->AddTokensForLayersInRegion(link, dirty, &fContentRegion);
|
||||
// mark the end of the token "list"
|
||||
link.Attach<int32>(B_NULL_TOKEN);
|
||||
@ -1767,6 +1775,7 @@ WindowLayer::BeginUpdate(BPrivate::PortLink& link)
|
||||
&fContentRegion, true);
|
||||
#endif
|
||||
} else {
|
||||
printf("BeginUpdate() but no update requested!!\n");
|
||||
link.StartMessage(B_ERROR);
|
||||
link.Flush();
|
||||
fprintf(stderr, "WindowLayer::BeginUpdate() - no update requested!\n");
|
||||
|
Loading…
Reference in New Issue
Block a user