AS_SET_CURSOR now grabs a reference to the current app cursor, so that it won't be
deleted when the local BCursor object is gone. This should fix bug #275 (ScummVM should no longer have two cursors), not tested yet, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16676 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -938,14 +938,22 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
link.Read<bool>(&sync);
|
link.Read<bool>(&sync);
|
||||||
link.Read<int32>(&token);
|
link.Read<int32>(&token);
|
||||||
|
|
||||||
|
ServerCursor* oldCursor = fAppCursor;
|
||||||
fAppCursor = fDesktop->GetCursorManager().FindCursor(token);
|
fAppCursor = fDesktop->GetCursorManager().FindCursor(token);
|
||||||
if (fAppCursor != NULL)
|
if (fAppCursor != NULL) {
|
||||||
|
fAppCursor->Acquire();
|
||||||
|
// TODO: This is wrong: We need to take view cursors into account here!
|
||||||
fDesktop->HWInterface()->SetCursor(fAppCursor);
|
fDesktop->HWInterface()->SetCursor(fAppCursor);
|
||||||
else {
|
} else {
|
||||||
// if there is no new cursor, we just set the default cursor
|
// if the new cursor doesn't exist, we just set the default cursor
|
||||||
fDesktop->HWInterface()->SetCursor(fDesktop->GetCursorManager().GetCursor(B_CURSOR_DEFAULT));
|
// TODO: This is wrong: We need to take view cursors into account here!
|
||||||
|
fDesktop->HWInterface()->SetCursor(
|
||||||
|
fDesktop->GetCursorManager().GetCursor(B_CURSOR_DEFAULT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldCursor != NULL)
|
||||||
|
oldCursor->Release();
|
||||||
|
|
||||||
if (sync) {
|
if (sync) {
|
||||||
// The application is expecting a reply
|
// The application is expecting a reply
|
||||||
fLink.StartMessage(B_OK);
|
fLink.StartMessage(B_OK);
|
||||||
|
|||||||
Reference in New Issue
Block a user