From e4ea54bdb7604cad577e2ecdbdf2f0e4c783eb84 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sat, 15 Aug 2009 17:22:19 +0000 Subject: [PATCH] Getting the screen mode should be protected, at least by a read lock. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32420 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerApp.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index ba0e163028..e66fe0804a 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -2285,15 +2285,18 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) uint32 workspace; link.Read(&workspace); - // TODO: the display_mode can be different between - // the various screens. - // We have the screen_id and the workspace number, with these we - // need to find the corresponding "driver", and call getmode on it display_mode mode; - fDesktop->ScreenAt(0)->GetMode(&mode); - // actually this isn't still enough as different workspaces can - // have different display_modes - + if (fDesktop->LockSingleWindow()) { + // TODO: the display_mode can be different between + // the various screens. + // We have the screen_id and the workspace number, + // with these we need to find the corresponding + // "driver", and call getmode on it + fDesktop->ScreenAt(0)->GetMode(&mode); + // actually this isn't still enough as different + // workspaces can have different display_modes + fDesktop->UnlockSingleWindow(); + } fLink.StartMessage(B_OK); fLink.Attach(mode); fLink.Flush(); @@ -2995,9 +2998,9 @@ ServerApp::CreatePicture(const ServerPicture* original) { ServerPicture* picture; if (original != NULL) - picture = new(std::nothrow) ServerPicture(*original); + picture = new (std::nothrow) ServerPicture(*original); else - picture = new(std::nothrow) ServerPicture(); + picture = new (std::nothrow) ServerPicture(); if (picture != NULL) fPictureList.AddItem(picture);