app_server: Acquire the window lock in Set*Cursor.
SetScreenMode() and other methods around here also acquire it
in this way.
Adjust one place in ServerApp that would cause a lock-order-inversion
otherwise.
Should fix #19837.
Diff
src/servers/app/Desktop.cpp | 4 ++++
src/servers/app/ServerApp.cpp | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
@@ -693,6 +693,8 @@
void
Desktop::SetCursor(ServerCursor* newCursor)
{
AutoWriteLocker _(fWindowLock);
if (newCursor == NULL)
newCursor = fCursorManager.GetCursor(B_CURSOR_ID_SYSTEM_DEFAULT);
@@ -716,6 +718,8 @@
void
Desktop::SetManagementCursor(ServerCursor* newCursor)
{
AutoWriteLocker _(fWindowLock);
if (newCursor == fManagementCursor)
return;
@@ -1080,10 +1080,10 @@
fAppCursor.SetTo(fDesktop->GetCursorManager().FindCursor(token), false);
fDesktop->GetCursorManager().Unlock();
if (_HasWindowUnderMouse())
fDesktop->SetCursor(CurrentCursor());
fDesktop->GetCursorManager().Unlock();
if (sync) {