From 1486d5790807b03895cd2e161405ebb782685d44 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 5 Aug 2025 13:32:41 -0400 Subject: [PATCH] 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 07f87734c528bcfc1962d69fcb0784ce45fd1e5a (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.) --- src/kits/interface/View.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index b3a9dfc013..020e42ba79 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -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);