diff --git a/src/servers/app/DefaultDecorator.cpp b/src/servers/app/DefaultDecorator.cpp index c75dc503aa..2ca05d72f4 100644 --- a/src/servers/app/DefaultDecorator.cpp +++ b/src/servers/app/DefaultDecorator.cpp @@ -242,6 +242,29 @@ DefaultDecorator::RegionAt(BPoint where) const } +bool +DefaultDecorator::SetRegionHighlight(Region region, uint8 highlight, + BRegion* dirty) +{ + // Invalidate the bitmap caches for the close/zoom button, when the + // highlight changes. + switch (region) { + case REGION_CLOSE_BUTTON: + if (highlight != RegionHighlight(region)) + memset(&fCloseBitmaps, 0, sizeof(fCloseBitmaps)); + break; + case REGION_ZOOM_BUTTON: + if (highlight != RegionHighlight(region)) + memset(&fZoomBitmaps, 0, sizeof(fZoomBitmaps)); + break; + default: + break; + } + + return Decorator::SetRegionHighlight(region, highlight, dirty); +} + + void DefaultDecorator::ExtendDirtyRegion(Region region, BRegion& dirty) { @@ -1500,7 +1523,6 @@ DefaultDecorator::_GetBitmapForButton(Component item, bool down, int32 width, } - void DefaultDecorator::_GetComponentColors(Component component, ComponentColors _colors) diff --git a/src/servers/app/DefaultDecorator.h b/src/servers/app/DefaultDecorator.h index b371b7f740..329297cafd 100644 --- a/src/servers/app/DefaultDecorator.h +++ b/src/servers/app/DefaultDecorator.h @@ -40,6 +40,9 @@ public: virtual Region RegionAt(BPoint where) const; + virtual bool SetRegionHighlight(Region region, + uint8 highlight, BRegion* dirty); + virtual void ExtendDirtyRegion(Region region, BRegion& dirty);