* it should be better to lock before accessing the data, even if reading only
* after this change, I have not spotted "left behind" cursors again, but it might just be bad luck... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21966 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -382,18 +382,20 @@ HWInterface::HideOverlay(Overlay* overlay)
|
|||||||
bool
|
bool
|
||||||
HWInterface::HideSoftwareCursor(const BRect& area)
|
HWInterface::HideSoftwareCursor(const BRect& area)
|
||||||
{
|
{
|
||||||
|
if (!fSoftwareCursorLock.Lock())
|
||||||
|
return false;
|
||||||
if (fCursorAreaBackup && !fCursorAreaBackup->cursor_hidden) {
|
if (fCursorAreaBackup && !fCursorAreaBackup->cursor_hidden) {
|
||||||
BRect backupArea(fCursorAreaBackup->left,
|
BRect backupArea(fCursorAreaBackup->left,
|
||||||
fCursorAreaBackup->top,
|
fCursorAreaBackup->top,
|
||||||
fCursorAreaBackup->right,
|
fCursorAreaBackup->right,
|
||||||
fCursorAreaBackup->bottom);
|
fCursorAreaBackup->bottom);
|
||||||
if (area.Intersects(backupArea)) {
|
if (area.Intersects(backupArea)) {
|
||||||
fSoftwareCursorLock.Lock();
|
|
||||||
_RestoreCursorArea();
|
_RestoreCursorArea();
|
||||||
// do not unlock the cursor lock
|
// do not unlock the cursor lock
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fSoftwareCursorLock.Unlock();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user