Invalidate the footprint at the right time to fix the calculation of the dirty border region.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37610 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2010-07-20 04:33:24 +00:00
parent 604ae84e46
commit 962281e833
3 changed files with 22 additions and 11 deletions

View File

@ -99,9 +99,9 @@ Decorator::SetFlags(uint32 flags, BRegion* updateRegion)
if (flags & B_NOT_RESIZABLE)
flags |= B_NOT_H_RESIZABLE | B_NOT_V_RESIZABLE;
fFootprintValid = false;
// the border might have changed (smaller/larger tab)
_SetFlags(flags, updateRegion);
_InvalidateFootprint();
// the border might have changed (smaller/larger tab)
}
@ -110,8 +110,8 @@ Decorator::SetFlags(uint32 flags, BRegion* updateRegion)
void
Decorator::FontsChanged(DesktopSettings& settings, BRegion* updateRegion)
{
fFootprintValid = false;
_FontsChanged(settings, updateRegion);
_InvalidateFootprint();
}
@ -122,9 +122,9 @@ void
Decorator::SetLook(DesktopSettings& settings, window_look look,
BRegion* updateRect)
{
fFootprintValid = false;
// the border very likely changed
_SetLook(settings, look, updateRect);
_InvalidateFootprint();
// the border very likely changed
}
@ -183,12 +183,12 @@ Decorator::SetZoom(bool pressed)
void
Decorator::SetTitle(const char* string, BRegion* updateRegion)
{
fFootprintValid = false;
// the border very likely changed
fTitle.SetTo(string);
_SetTitle(string, updateRegion);
_InvalidateFootprint();
// the border very likely changed
// TODO: redraw?
}
@ -406,8 +406,8 @@ Decorator::ResizeBy(float x, float y, BRegion* dirty)
void
Decorator::ResizeBy(BPoint offset, BRegion* dirty)
{
fFootprintValid = false;
_ResizeBy(offset, dirty);
_InvalidateFootprint();
}
@ -415,7 +415,7 @@ bool
Decorator::SetTabLocation(float location, BRegion* updateRegion)
{
if (_SetTabLocation(location, updateRegion)) {
fFootprintValid = false;
_InvalidateFootprint();
return true;
}
return false;
@ -426,7 +426,7 @@ bool
Decorator::SetSettings(const BMessage& settings, BRegion* updateRegion)
{
if (_SetSettings(settings, updateRegion)) {
fFootprintValid = false;
_InvalidateFootprint();
return true;
}
return false;
@ -667,3 +667,10 @@ void
Decorator::_GetFootprint(BRegion *region)
{
}
void
Decorator::_InvalidateFootprint()
{
fFootprintValid = false;
}

View File

@ -158,6 +158,7 @@ protected:
BRegion* updateRegion = NULL);
virtual void _GetFootprint(BRegion *region);
void _InvalidateFootprint();
DrawingEngine* fDrawingEngine;
DrawState fDrawState;

View File

@ -775,6 +775,7 @@ DefaultDecorator::_FontsChanged(DesktopSettings& settings,
_InvalidateBitmaps();
_DoLayout();
_InvalidateFootprint();
if (updateRegion != NULL)
updateRegion->Include(&GetFootprint());
}
@ -796,6 +797,7 @@ DefaultDecorator::_SetLook(DesktopSettings& settings, window_look look,
_InvalidateBitmaps();
_DoLayout();
_InvalidateFootprint();
if (updateRegion != NULL)
updateRegion->Include(&GetFootprint());
}
@ -813,6 +815,7 @@ DefaultDecorator::_SetFlags(uint32 flags, BRegion* updateRegion)
fFlags = flags;
_DoLayout();
_InvalidateFootprint();
if (updateRegion != NULL)
updateRegion->Include(&GetFootprint());
}