* removed code duplication in BView::check_lock() and do_owner_check(),
* revised use of check_lock() versus do_owner_check() (do_owner_check() is supposed to drop you into the debugger if there is no owner, otherwise it behaves like check_lock()) * ConstrainClippingRegion() no longer transmits empty regions to the app_server. I would have thought that my fix to ServerLink would have solved the issue I was investigating, but only this commit fixes it. Maybe the last commit would have fixed it if I did a "jam clean"... * WonderBrush draws the icons again on mouse over... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21910 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1011,6 +1011,8 @@ BPoint
|
|||||||
BView::Origin() const
|
BView::Origin() const
|
||||||
{
|
{
|
||||||
if (!fState->IsValid(B_VIEW_ORIGIN_BIT)) {
|
if (!fState->IsValid(B_VIEW_ORIGIN_BIT)) {
|
||||||
|
// we don't keep graphics state information, therefor
|
||||||
|
// we need to ask the server for the origin after PopState()
|
||||||
do_owner_check();
|
do_owner_check();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_LAYER_GET_ORIGIN);
|
fOwner->fLink->StartMessage(AS_LAYER_GET_ORIGIN);
|
||||||
@@ -2169,7 +2171,6 @@ BView::SetFont(const BFont* font, uint32 mask)
|
|||||||
|
|
||||||
if (fOwner) {
|
if (fOwner) {
|
||||||
check_lock();
|
check_lock();
|
||||||
do_owner_check();
|
|
||||||
|
|
||||||
fState->UpdateServerFontState(*fOwner->fLink);
|
fState->UpdateServerFontState(*fOwner->fLink);
|
||||||
}
|
}
|
||||||
@@ -2260,7 +2261,8 @@ BView::GetClippingRegion(BRegion* region) const
|
|||||||
// changed, so it is always read from the serber
|
// changed, so it is always read from the serber
|
||||||
region->MakeEmpty();
|
region->MakeEmpty();
|
||||||
|
|
||||||
if (fOwner && do_owner_check()) {
|
if (fOwner) {
|
||||||
|
check_lock();
|
||||||
fOwner->fLink->StartMessage(AS_LAYER_GET_CLIP_REGION);
|
fOwner->fLink->StartMessage(AS_LAYER_GET_CLIP_REGION);
|
||||||
|
|
||||||
int32 code;
|
int32 code;
|
||||||
@@ -2277,21 +2279,20 @@ void
|
|||||||
BView::ConstrainClippingRegion(BRegion* region)
|
BView::ConstrainClippingRegion(BRegion* region)
|
||||||
{
|
{
|
||||||
if (do_owner_check()) {
|
if (do_owner_check()) {
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_LAYER_SET_CLIP_REGION);
|
fOwner->fLink->StartMessage(AS_LAYER_SET_CLIP_REGION);
|
||||||
|
|
||||||
if (region) {
|
if (region) {
|
||||||
int32 count = region->CountRects();
|
int32 count = region->CountRects();
|
||||||
fOwner->fLink->Attach<int32>(count);
|
fOwner->fLink->Attach<int32>(count);
|
||||||
fOwner->fLink->AttachRegion(*region);
|
if (count > 0)
|
||||||
|
fOwner->fLink->AttachRegion(*region);
|
||||||
} else {
|
} else {
|
||||||
fOwner->fLink->Attach<int32>(-1);
|
fOwner->fLink->Attach<int32>(-1);
|
||||||
// '-1' means that in the app_server, there won't be any 'local'
|
// '-1' means that in the app_server, there won't be any 'local'
|
||||||
// clipping region (it will be NULL)
|
// clipping region (it will be NULL)
|
||||||
}
|
}
|
||||||
|
|
||||||
// we flush here because app_server waits for all the rects
|
_FlushIfNotInTransaction();
|
||||||
fOwner->fLink->Flush();
|
|
||||||
|
|
||||||
fState->valid_flags &= ~B_VIEW_CLIP_REGION_BIT;
|
fState->valid_flags &= ~B_VIEW_CLIP_REGION_BIT;
|
||||||
fState->archiving_flags |= B_VIEW_CLIP_REGION_BIT;
|
fState->archiving_flags |= B_VIEW_CLIP_REGION_BIT;
|
||||||
@@ -4666,6 +4667,7 @@ BView::_Pulse()
|
|||||||
void
|
void
|
||||||
BView::_UpdateStateForRemove()
|
BView::_UpdateStateForRemove()
|
||||||
{
|
{
|
||||||
|
// TODO: check_lock() would be good enough, no?
|
||||||
if (!do_owner_check())
|
if (!do_owner_check())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -4767,23 +4769,12 @@ BView::do_owner_check() const
|
|||||||
{
|
{
|
||||||
STRACE(("BView(%s)::do_owner_check()...", Name()));
|
STRACE(("BView(%s)::do_owner_check()...", Name()));
|
||||||
|
|
||||||
int32 serverToken = _get_object_token_(this);
|
|
||||||
|
|
||||||
if (fOwner == NULL) {
|
if (fOwner == NULL) {
|
||||||
debugger("View method requires owner and doesn't have one.");
|
debugger("View method requires owner and doesn't have one.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fOwner->check_lock();
|
check_lock();
|
||||||
|
|
||||||
if (fOwner->fLastViewToken != serverToken) {
|
|
||||||
STRACE(("contacting app_server... sending token: %ld\n", serverToken));
|
|
||||||
fOwner->fLink->StartMessage(AS_SET_CURRENT_LAYER);
|
|
||||||
fOwner->fLink->Attach<int32>(serverToken);
|
|
||||||
|
|
||||||
fOwner->fLastViewToken = serverToken;
|
|
||||||
} else
|
|
||||||
STRACE(("this is the lastViewToken\n"));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1802,7 +1802,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
|||||||
if (rectCount >= 0) {
|
if (rectCount >= 0) {
|
||||||
// we are supposed to set the clipping region
|
// we are supposed to set the clipping region
|
||||||
BRegion region;
|
BRegion region;
|
||||||
if (link.ReadRegion(®ion) < B_OK)
|
if (rectCount > 0 && link.ReadRegion(®ion) < B_OK)
|
||||||
break;
|
break;
|
||||||
fCurrentLayer->SetUserClipping(®ion);
|
fCurrentLayer->SetUserClipping(®ion);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user