At least temporary fix for the Deskbar not updating additional items (unless you resize it).

The problem was that the view's screen clipping was not updated if its frame did not change
because of a resized parent - but that might be needed if the new parent frame reveals a new
portion of that view.
I added a TODO so that if there is a way to test for this case, we only need to invalidate
the clipping if really needed. For now, we always do it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19695 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-01-04 12:28:31 +00:00
parent 25df172b72
commit c6f9f65dff
5 changed files with 23 additions and 9 deletions

View File

@ -133,19 +133,27 @@ CursorManager::AddCursor(ServerCursor* cursor, int32 token)
/*!
\brief Releases a reference to a cursor
\brief Removes a cursor if it's not referenced anymore.
If this was the last reference to this cursor, it will be deleted.
Only if the cursor is deleted, \c true is returned.
*/
void
bool
CursorManager::RemoveCursor(ServerCursor* cursor)
{
if (!Lock())
return;
return false;
if (cursor->ReferenceCount() > 0) {
// cursor has been referenced again in the mean time
Unlock();
return false;
}
_RemoveCursor(cursor);
Unlock();
return true;
}

View File

@ -39,7 +39,7 @@ class CursorManager : public BLocker {
int32 AddCursor(ServerCursor* cursor, int32 token = -1);
void DeleteCursors(team_id team);
void RemoveCursor(ServerCursor* cursor);
bool RemoveCursor(ServerCursor* cursor);
void SetCursorSet(const char* path);
ServerCursor* GetCursor(cursor_which which);

View File

@ -197,11 +197,10 @@ ServerCursor::Release()
return false;
}
if (fManager) {
fManager->RemoveCursor(this);
}
delete this;
if (fManager && !fManager->RemoveCursor(this))
return false;
delete this;
return true;
}
return false;

View File

@ -50,6 +50,7 @@ class ServerCursor : public ServerBitmap {
void Acquire()
{ atomic_add(&fReferenceCount, 1); }
bool Release();
int32 ReferenceCount() { return fReferenceCount; }
void SetPendingViewCursor(bool pending);
@ -63,7 +64,7 @@ class ServerCursor : public ServerBitmap {
BPoint fHotSpot;
team_id fOwningTeam;
int32 fReferenceCount;
vint32 fReferenceCount;
uint8* fCursorData;
CursorManager* fManager;
vint32 fPendingViewCursor;

View File

@ -900,6 +900,12 @@ ViewLayer::ParentResized(int32 x, int32 y, BRegion* dirtyRegion)
newFrame.top - fFrame.top, dirtyRegion);
ResizeBy(widthDiff, heightDiff, dirtyRegion);
} else {
// TODO: this covers the fact that our screen clipping might change
// when the parent changes its size, even though our frame stays
// the same - there might be a way to test for this, but axeld doesn't
// know, stippi should look into this when he's back :)
InvalidateScreenClipping();
}
}