BView: Check if the region is in-bounds before invalidating.
The app_server will just ignore the request anyway in that case,
so we can save a round-trip.
This genericizes the change to BColumnListView done in
07f87734c5 (which will this be reverted.)
It seems to happen occasionally outside that context (I added logging
and saw it triggered dozens or more times in some applications.)
This commit is contained in:
@@ -4485,6 +4485,9 @@ BView::Invalidate(BRect invalRect)
|
||||
if (!invalRect.IsValid())
|
||||
return;
|
||||
|
||||
if (!fBounds.Intersects(invalRect))
|
||||
return;
|
||||
|
||||
_CheckLockAndSwitchCurrent();
|
||||
|
||||
fOwner->fLink->StartMessage(AS_VIEW_INVALIDATE_RECT);
|
||||
@@ -4508,6 +4511,9 @@ BView::Invalidate(const BRegion* region)
|
||||
if (region == NULL || fOwner == NULL)
|
||||
return;
|
||||
|
||||
if (!fBounds.Intersects(region->Frame()))
|
||||
return;
|
||||
|
||||
_CheckLockAndSwitchCurrent();
|
||||
|
||||
fOwner->fLink->StartMessage(AS_VIEW_INVALIDATE_REGION);
|
||||
|
||||
Reference in New Issue
Block a user