Fixed regression in SetViewCursor(). It wasn't possible anymore to switch

back to the system default cursor. For that cursor token, the global cursor
manager returns NULL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31138 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-06-20 15:26:34 +00:00
parent 1f9fd6d866
commit 5c5195ee7e
+4 -3
View File
@@ -931,13 +931,14 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
if (fDesktop->GetCursorManager().Lock()) { if (fDesktop->GetCursorManager().Lock()) {
ServerCursor* cursor = fDesktop->GetCursorManager().FindCursor( ServerCursor* cursor = fDesktop->GetCursorManager().FindCursor(
info.cursorToken); info.cursorToken);
// If we found a cursor, make sure it doesn't go away. // If we found a cursor, make sure it doesn't go away. If we
// get a NULL cursor, it probably means we are supposed to use
// the system default cursor.
if (cursor != NULL) if (cursor != NULL)
cursor->Acquire(); cursor->Acquire();
fDesktop->GetCursorManager().Unlock(); fDesktop->GetCursorManager().Unlock();
if (cursor != NULL) {
// We need to acquire the write lock here, since we cannot // We need to acquire the write lock here, since we cannot
// afford that the window thread to which the view belongs // afford that the window thread to which the view belongs
// is running and messing with that same view. // is running and messing with that same view.
@@ -966,9 +967,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
fDesktop->UnlockAllWindows(); fDesktop->UnlockAllWindows();
// Release the temporary reference. // Release the temporary reference.
if (cursor != NULL)
cursor->Release(); cursor->Release();
} }
}
if (info.sync) { if (info.sync) {
// sync the client (it can now delete the cursor) // sync the client (it can now delete the cursor)