Added support for not visible cursors - defaults to invisible now!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14948 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a512a89b27
commit
af8899c4bf
@ -15,7 +15,7 @@ HWInterface::HWInterface(bool doubleBuffered)
|
|||||||
: MultiLocker("hw interface lock"),
|
: MultiLocker("hw interface lock"),
|
||||||
fCursorAreaBackup(NULL),
|
fCursorAreaBackup(NULL),
|
||||||
fCursor(NULL),
|
fCursor(NULL),
|
||||||
fCursorVisible(true),
|
fCursorVisible(false),
|
||||||
fCursorLocation(0, 0),
|
fCursorLocation(0, 0),
|
||||||
fDoubleBuffered(doubleBuffered),
|
fDoubleBuffered(doubleBuffered),
|
||||||
// fUpdateExecutor(new UpdateQueue(this))
|
// fUpdateExecutor(new UpdateQueue(this))
|
||||||
@ -48,15 +48,18 @@ HWInterface::SetCursor(ServerCursor* cursor)
|
|||||||
delete fCursor;
|
delete fCursor;
|
||||||
delete fCursorAreaBackup;
|
delete fCursorAreaBackup;
|
||||||
fCursor = cursor;
|
fCursor = cursor;
|
||||||
Invalidate(oldFrame);
|
if (fCursorVisible)
|
||||||
|
Invalidate(oldFrame);
|
||||||
BRect r = _CursorFrame();
|
BRect r = _CursorFrame();
|
||||||
if (fCursor && !IsDoubleBuffered()) {
|
if (fCursor && !IsDoubleBuffered()) {
|
||||||
fCursorAreaBackup = new buffer_clip(r.IntegerWidth() + 1,
|
fCursorAreaBackup = new buffer_clip(r.IntegerWidth() + 1,
|
||||||
r.IntegerHeight() + 1);
|
r.IntegerHeight() + 1);
|
||||||
_DrawCursor(r);
|
if (fCursorVisible)
|
||||||
|
_DrawCursor(r);
|
||||||
} else
|
} else
|
||||||
fCursorAreaBackup = NULL;
|
fCursorAreaBackup = NULL;
|
||||||
Invalidate(r);
|
if (fCursorVisible)
|
||||||
|
Invalidate(r);
|
||||||
}
|
}
|
||||||
WriteUnlock();
|
WriteUnlock();
|
||||||
}
|
}
|
||||||
@ -80,9 +83,9 @@ bool
|
|||||||
HWInterface::IsCursorVisible()
|
HWInterface::IsCursorVisible()
|
||||||
{
|
{
|
||||||
bool visible = true;
|
bool visible = true;
|
||||||
if (WriteLock()) {
|
if (ReadLock()) {
|
||||||
visible = fCursorVisible;
|
visible = fCursorVisible;
|
||||||
WriteUnlock();
|
ReadUnlock();
|
||||||
}
|
}
|
||||||
return visible;
|
return visible;
|
||||||
}
|
}
|
||||||
@ -96,7 +99,7 @@ HWInterface::MoveCursorTo(const float& x, const float& y)
|
|||||||
if (p != fCursorLocation) {
|
if (p != fCursorLocation) {
|
||||||
BRect oldFrame = _CursorFrame();
|
BRect oldFrame = _CursorFrame();
|
||||||
fCursorLocation = p;
|
fCursorLocation = p;
|
||||||
if (fCursorAreaBackup) {
|
if (fCursorAreaBackup && fCursorVisible) {
|
||||||
// means we have a software cursor which we need to draw
|
// means we have a software cursor which we need to draw
|
||||||
_RestoreCursorArea();
|
_RestoreCursorArea();
|
||||||
_DrawCursor(_CursorFrame());
|
_DrawCursor(_CursorFrame());
|
||||||
|
Loading…
Reference in New Issue
Block a user