diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index bcca14e84b..1ba7eda1db 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -933,24 +933,22 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) // 2) int32 token ID of the cursor to set // 3) port_id port to receive a reply. Only exists if the sync flag is true. bool sync; - int32 token = B_NULL_TOKEN; + int32 token; link.Read(&sync); - link.Read(&token); + if (link.Read(&token) != B_OK) + break; ServerCursor* oldCursor = fAppCursor; fAppCursor = fDesktop->GetCursorManager().FindCursor(token); if (fAppCursor != NULL) { fAppCursor->Acquire(); - // TODO: This is wrong: We need to take view cursors into account here! fDesktop->HWInterface()->SetCursor(fAppCursor); - } else { - // if the new cursor doesn't exist, we just set the default cursor - // TODO: This is wrong: We need to take view cursors into account here! - fDesktop->HWInterface()->SetCursor( - fDesktop->GetCursorManager().GetCursor(B_CURSOR_DEFAULT)); } + // TODO: This is wrong: We need to take view cursors into account here! + fDesktop->SetCursor(fAppCursor); + if (oldCursor != NULL) oldCursor->Release();