Renamed Write[Un]lockWindows() to [Un]lockAllWindows(), and Read[Un]lockWindows() to
[Un]lockSingleWindow(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15509 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5d93a13bb4
commit
61fed21b04
@ -144,7 +144,7 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
|
||||
|
||||
bigtime_t now = system_time();
|
||||
|
||||
if (!fDesktop->ReadLockWindows())
|
||||
if (!fDesktop->LockSingleWindow())
|
||||
return B_DISPATCH_MESSAGE;
|
||||
|
||||
EventTarget* focus = NULL;
|
||||
@ -167,7 +167,7 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
|
||||
fLastFocus = focus;
|
||||
}
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
|
||||
// we always allow to switch focus after the enter key has pressed
|
||||
if (key == B_ENTER)
|
||||
@ -196,7 +196,7 @@ MouseFilter::Filter(BMessage* message, EventTarget** _target, int32* _viewToken)
|
||||
if (message->FindPoint("where", &where) != B_OK)
|
||||
return B_DISPATCH_MESSAGE;
|
||||
|
||||
if (!fDesktop->WriteLockWindows())
|
||||
if (!fDesktop->LockAllWindows())
|
||||
return B_DISPATCH_MESSAGE;
|
||||
|
||||
WindowLayer* window = fDesktop->MouseEventWindow();
|
||||
@ -227,7 +227,7 @@ MouseFilter::Filter(BMessage* message, EventTarget** _target, int32* _viewToken)
|
||||
} else
|
||||
*_target = NULL;
|
||||
|
||||
fDesktop->WriteUnlockWindows();
|
||||
fDesktop->UnlockAllWindows();
|
||||
|
||||
return B_DISPATCH_MESSAGE;
|
||||
}
|
||||
@ -574,11 +574,11 @@ Desktop::UpdateWorkspaces()
|
||||
void
|
||||
Desktop::SetWorkspace(int32 index)
|
||||
{
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
DesktopSettings settings(this);
|
||||
|
||||
if (index < 0 || index >= settings.WorkspacesCount() || index == fCurrentWorkspace) {
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -683,7 +683,7 @@ Desktop::SetWorkspace(int32 index)
|
||||
_WindowChanged(NULL);
|
||||
MarkDirty(dirty);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -876,7 +876,7 @@ Desktop::_WindowChanged(WindowLayer* window)
|
||||
void
|
||||
Desktop::SetFocusWindow(WindowLayer* focus)
|
||||
{
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
bool hasModal = _WindowHasModal(focus);
|
||||
@ -886,7 +886,7 @@ Desktop::SetFocusWindow(WindowLayer* focus)
|
||||
if (focus == fFocus && focus != NULL && (focus->Flags() & B_AVOID_FOCUS) == 0
|
||||
&& !hasModal) {
|
||||
// the window that is supposed to get focus already has focus
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -915,7 +915,7 @@ Desktop::SetFocusWindow(WindowLayer* focus)
|
||||
if (focus != NULL)
|
||||
focus->SetFocus(true);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -983,13 +983,13 @@ Desktop::ActivateWindow(WindowLayer* window)
|
||||
// TODO: support B_NOT_ANCHORED_ON_ACTIVATE
|
||||
// TODO: take care about floating windows
|
||||
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
if (window == FrontWindow()) {
|
||||
SetFocusWindow(window);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1026,14 +1026,14 @@ Desktop::ActivateWindow(WindowLayer* window)
|
||||
_BringWindowsToFront(windows, kWorkingList, true);
|
||||
SetFocusWindow(window);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Desktop::SendWindowBehind(WindowLayer* window, WindowLayer* behindOf)
|
||||
{
|
||||
if (window == BackWindow() || !WriteLockWindows())
|
||||
if (window == BackWindow() || !LockAllWindows())
|
||||
return;
|
||||
|
||||
// Is this a valid behindOf window?
|
||||
@ -1065,7 +1065,7 @@ Desktop::SendWindowBehind(WindowLayer* window, WindowLayer* behindOf)
|
||||
SetFocusWindow(FrontWindow());
|
||||
//_WindowsChanged();
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -1075,7 +1075,7 @@ Desktop::ShowWindow(WindowLayer* window)
|
||||
if (!window->IsHidden())
|
||||
return;
|
||||
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
|
||||
window->SetHidden(false);
|
||||
|
||||
@ -1085,14 +1085,14 @@ Desktop::ShowWindow(WindowLayer* window)
|
||||
ActivateWindow(window);
|
||||
} else {
|
||||
// then we don't need to send the fake mouse event either
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
return;
|
||||
}
|
||||
|
||||
if (WorkspacesLayer* layer = dynamic_cast<WorkspacesLayer*>(window->TopLayer()))
|
||||
fWorkspacesLayer = layer;
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
|
||||
// If the mouse cursor is directly over the newly visible window,
|
||||
// we'll send a fake mouse moved message to the window, so that
|
||||
@ -1104,14 +1104,14 @@ Desktop::ShowWindow(WindowLayer* window)
|
||||
|
||||
int32 viewToken = B_NULL_TOKEN;
|
||||
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
|
||||
if (WindowAt(where) == window) {
|
||||
ViewLayer* view = window->ViewAt(where);
|
||||
if (view != NULL)
|
||||
viewToken = view->Token();
|
||||
}
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
|
||||
if (viewToken != B_NULL_TOKEN)
|
||||
EventDispatcher().SendFakeMouseMoved(window->EventTarget(), viewToken);
|
||||
@ -1124,7 +1124,7 @@ Desktop::HideWindow(WindowLayer* window)
|
||||
if (window->IsHidden())
|
||||
return;
|
||||
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
window->SetHidden(true);
|
||||
@ -1141,7 +1141,7 @@ Desktop::HideWindow(WindowLayer* window)
|
||||
if (dynamic_cast<WorkspacesLayer*>(window->TopLayer()) != NULL)
|
||||
fWorkspacesLayer = NULL;
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -1198,7 +1198,7 @@ Desktop::_HideWindow(WindowLayer* window)
|
||||
void
|
||||
Desktop::MoveWindowBy(WindowLayer* window, float x, float y)
|
||||
{
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
// the dirty region starts with the visible area of the window being moved
|
||||
@ -1234,14 +1234,14 @@ Desktop::MoveWindowBy(WindowLayer* window, float x, float y)
|
||||
_SetBackground(background);
|
||||
_WindowChanged(window);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Desktop::ResizeWindowBy(WindowLayer* window, float x, float y)
|
||||
{
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
BRegion newDirtyRegion;
|
||||
@ -1261,7 +1261,7 @@ Desktop::ResizeWindowBy(WindowLayer* window, float x, float y)
|
||||
_SetBackground(background);
|
||||
_WindowChanged(window);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -1309,7 +1309,7 @@ Desktop::_ChangeWindowWorkspaces(WindowLayer* window, uint32 oldWorkspaces,
|
||||
{
|
||||
// apply changes to the workspaces' window lists
|
||||
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
|
||||
for (int32 i = 0; i < kMaxWorkspaces; i++) {
|
||||
if (workspace_in_workspaces(i, oldWorkspaces)) {
|
||||
@ -1349,27 +1349,27 @@ Desktop::_ChangeWindowWorkspaces(WindowLayer* window, uint32 oldWorkspaces,
|
||||
// take care about modals and floating windows
|
||||
_UpdateSubsetWorkspaces(window);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Desktop::SetWindowWorkspaces(WindowLayer* window, uint32 workspaces)
|
||||
{
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
|
||||
if (window->IsNormal() && workspaces == B_CURRENT_WORKSPACE)
|
||||
workspaces = workspace_to_workspaces(CurrentWorkspace());
|
||||
|
||||
_ChangeWindowWorkspaces(window, window->Workspaces(), workspaces);
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Desktop::AddWindow(WindowLayer *window)
|
||||
{
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
|
||||
fAllWindows.AddWindow(window);
|
||||
if (!window->IsNormal())
|
||||
@ -1384,14 +1384,14 @@ Desktop::AddWindow(WindowLayer *window)
|
||||
}
|
||||
|
||||
_ChangeWindowWorkspaces(window, 0, window->Workspaces());
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Desktop::RemoveWindow(WindowLayer *window)
|
||||
{
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
|
||||
if (!window->IsHidden())
|
||||
HideWindow(window);
|
||||
@ -1401,7 +1401,7 @@ Desktop::RemoveWindow(WindowLayer *window)
|
||||
fSubsetWindows.RemoveWindow(window);
|
||||
|
||||
_ChangeWindowWorkspaces(window, window->Workspaces(), 0);
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
|
||||
// make sure this window won't get any events anymore
|
||||
|
||||
@ -1434,7 +1434,7 @@ Desktop::SetWindowLook(WindowLayer *window, window_look newLook)
|
||||
if (window->Look() == newLook)
|
||||
return;
|
||||
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
BRegion dirty;
|
||||
@ -1449,7 +1449,7 @@ Desktop::SetWindowLook(WindowLayer *window, window_look newLook)
|
||||
|
||||
_TriggerWindowRedrawing(dirty);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -1459,7 +1459,7 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
|
||||
if (window->Feel() == newFeel)
|
||||
return;
|
||||
|
||||
WriteLockWindows();
|
||||
LockAllWindows();
|
||||
|
||||
bool wasNormal = window->IsNormal();
|
||||
|
||||
@ -1510,7 +1510,7 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
|
||||
if (window == FocusWindow() && !window->IsVisible())
|
||||
SetFocusWindow(FrontWindow());
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -1520,7 +1520,7 @@ Desktop::SetWindowFlags(WindowLayer *window, uint32 newFlags)
|
||||
if (window->Flags() == newFlags)
|
||||
return;
|
||||
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
BRegion dirty;
|
||||
@ -1536,14 +1536,14 @@ Desktop::SetWindowFlags(WindowLayer *window, uint32 newFlags)
|
||||
_TriggerWindowRedrawing(dirty);
|
||||
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Desktop::SetWindowTitle(WindowLayer *window, const char* title)
|
||||
{
|
||||
if (!WriteLockWindows())
|
||||
if (!LockAllWindows())
|
||||
return;
|
||||
|
||||
BRegion dirty;
|
||||
@ -1557,7 +1557,7 @@ Desktop::SetWindowTitle(WindowLayer *window, const char* title)
|
||||
_TriggerWindowRedrawing(dirty);
|
||||
}
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@ -1588,18 +1588,18 @@ Desktop::SetMouseEventWindow(WindowLayer* window)
|
||||
WindowLayer *
|
||||
Desktop::FindWindowLayerByClientToken(int32 token, team_id teamID)
|
||||
{
|
||||
ReadLockWindows();
|
||||
LockSingleWindow();
|
||||
|
||||
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
|
||||
window = window->NextWindow(kAllWindowList)) {
|
||||
if (window->ServerWindow()->ClientToken() == token
|
||||
&& window->ServerWindow()->ClientTeam() == teamID) {
|
||||
ReadUnlockWindows();
|
||||
UnlockSingleWindow();
|
||||
return window;
|
||||
}
|
||||
}
|
||||
|
||||
ReadUnlockWindows();
|
||||
UnlockSingleWindow();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1672,11 +1672,11 @@ Desktop::MarkDirty(BRegion& region)
|
||||
if (region.CountRects() == 0)
|
||||
return;
|
||||
|
||||
if (WriteLockWindows()) {
|
||||
if (LockAllWindows()) {
|
||||
// send redraw messages to all windows intersecting the dirty region
|
||||
_TriggerWindowRedrawing(region);
|
||||
|
||||
WriteUnlockWindows();
|
||||
UnlockAllWindows();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,17 +137,17 @@ class Desktop : public MessageLooper, public ScreenOwner {
|
||||
//WindowLayer* FindWindowLayerByServerToken(int32 token);
|
||||
|
||||
#if USE_MULTI_LOCKER
|
||||
bool ReadLockWindows() { return fWindowLock.ReadLock(); }
|
||||
void ReadUnlockWindows() { fWindowLock.ReadUnlock(); }
|
||||
bool LockSingleWindow() { return fWindowLock.ReadLock(); }
|
||||
void UnlockSingleWindow() { fWindowLock.ReadUnlock(); }
|
||||
|
||||
bool WriteLockWindows() { return fWindowLock.WriteLock(); }
|
||||
void WriteUnlockWindows() { fWindowLock.WriteUnlock(); }
|
||||
bool LockAllWindows() { return fWindowLock.WriteLock(); }
|
||||
void UnlockAllWindows() { fWindowLock.WriteUnlock(); }
|
||||
#else // USE_MULTI_LOCKER
|
||||
bool ReadLockWindows() { return fWindowLock.Lock(); }
|
||||
void ReadUnlockWindows() { fWindowLock.Unlock(); }
|
||||
bool LockSingleWindow() { return fWindowLock.Lock(); }
|
||||
void UnlockSingleWindow() { fWindowLock.Unlock(); }
|
||||
|
||||
bool WriteLockWindows() { return fWindowLock.Lock(); }
|
||||
void WriteUnlockWindows() { fWindowLock.Unlock(); }
|
||||
bool LockAllWindows() { return fWindowLock.Lock(); }
|
||||
void UnlockAllWindows() { fWindowLock.Unlock(); }
|
||||
#endif // USE_MULTI_LOCKER
|
||||
|
||||
void MarkDirty(BRegion& region);
|
||||
|
@ -2043,13 +2043,13 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
||||
link.Read<bool>(&makedefault);
|
||||
|
||||
status_t status = B_ERROR;
|
||||
if (fDesktop->WriteLockWindows()) {
|
||||
if (fDesktop->LockAllWindows()) {
|
||||
status = fDesktop->ScreenAt(0)->SetMode(mode);
|
||||
if (status == B_OK) {
|
||||
gInputManager->UpdateScreenBounds(fDesktop->ScreenAt(0)->Frame());
|
||||
fDesktop->ScreenChanged(fDesktop->ScreenAt(0));
|
||||
}
|
||||
fDesktop->WriteUnlockWindows();
|
||||
fDesktop->UnlockAllWindows();
|
||||
}
|
||||
|
||||
fLink.StartMessage(status);
|
||||
|
@ -320,9 +320,9 @@ ServerWindow::Show()
|
||||
|
||||
// TODO: race condition? maybe we need to dispatch a message to the desktop to show/hide us
|
||||
// instead of doing it from this thread.
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
fDesktop->ShowWindow(fWindowLayer);
|
||||
fDesktop->ReadLockWindows();
|
||||
fDesktop->LockSingleWindow();
|
||||
|
||||
if (fDirectWindowData != NULL)
|
||||
HandleDirectConnection(B_DIRECT_START | B_BUFFER_RESET);
|
||||
@ -344,9 +344,9 @@ ServerWindow::Hide()
|
||||
|
||||
// TODO: race condition? maybe we need to dispatch a message to the desktop to show/hide us
|
||||
// instead of doing it from this thread.
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
fDesktop->HideWindow(fWindowLayer);
|
||||
fDesktop->ReadLockWindows();
|
||||
fDesktop->LockSingleWindow();
|
||||
}
|
||||
|
||||
|
||||
@ -888,7 +888,7 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
|
||||
case AS_GET_MOUSE:
|
||||
{
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
DTRACE(("ServerWindow %s: Message AS_GET_MOUSE\n", fTitle));
|
||||
|
||||
// Returns
|
||||
@ -903,7 +903,7 @@ fDesktop->ReadUnlockWindows();
|
||||
fLink.Attach<BPoint>(where);
|
||||
fLink.Attach<int32>(buttons);
|
||||
fLink.Flush();
|
||||
fDesktop->ReadLockWindows();
|
||||
fDesktop->LockSingleWindow();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1080,7 +1080,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
|
||||
link.Read<uint32>(&eventMask);
|
||||
if (link.Read<uint32>(&options) == B_OK) {
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
fCurrentLayer->SetEventMask(eventMask, options);
|
||||
|
||||
if (eventMask != 0 || options != 0) {
|
||||
@ -1090,7 +1090,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
fDesktop->EventDispatcher().RemoveListener(EventTarget(),
|
||||
fCurrentLayer->Token());
|
||||
}
|
||||
fDesktop->ReadLockWindows();
|
||||
fDesktop->LockSingleWindow();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1101,7 +1101,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
|
||||
link.Read<uint32>(&eventMask);
|
||||
if (link.Read<uint32>(&options) == B_OK) {
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
if (eventMask != 0 || options != 0) {
|
||||
fDesktop->EventDispatcher().AddTemporaryListener(EventTarget(),
|
||||
fCurrentLayer->Token(), eventMask, options);
|
||||
@ -1109,7 +1109,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
fDesktop->EventDispatcher().RemoveTemporaryListener(EventTarget(),
|
||||
fCurrentLayer->Token());
|
||||
}
|
||||
fDesktop->ReadLockWindows();
|
||||
fDesktop->LockSingleWindow();
|
||||
}
|
||||
|
||||
// TODO: support B_LOCK_WINDOW_FOCUS option in Desktop
|
||||
@ -1127,7 +1127,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
float offsetX = x - fCurrentLayer->Frame().left;
|
||||
float offsetY = y - fCurrentLayer->Frame().top;
|
||||
|
||||
if (fDesktop->ReadLockWindows()) {
|
||||
if (fDesktop->LockSingleWindow()) {
|
||||
BRegion dirty;
|
||||
fCurrentLayer->MoveBy(offsetX, offsetY, &dirty);
|
||||
|
||||
@ -1140,7 +1140,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
parent->RebuildClipping(false);
|
||||
|
||||
fWindowLayer->MarkContentDirty(dirty);
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1156,7 +1156,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
float deltaWidth = newWidth - fCurrentLayer->Frame().Width();
|
||||
float deltaHeight = newHeight - fCurrentLayer->Frame().Height();
|
||||
|
||||
if (fDesktop->ReadLockWindows()) {
|
||||
if (fDesktop->LockSingleWindow()) {
|
||||
BRegion dirty;
|
||||
fCurrentLayer->ResizeBy(deltaWidth, deltaHeight, &dirty);
|
||||
|
||||
@ -1165,13 +1165,13 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
parent->RebuildClipping(false);
|
||||
|
||||
fWindowLayer->MarkContentDirty(dirty);
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AS_LAYER_GET_COORD:
|
||||
{
|
||||
fDesktop->ReadLockWindows();
|
||||
fDesktop->LockSingleWindow();
|
||||
|
||||
STRACE(("ServerWindow %s: Message AS_LAYER_GET_COORD: ViewLayer: %s\n", Title(), fCurrentLayer->Name()));
|
||||
fLink.StartMessage(B_OK);
|
||||
@ -1181,7 +1181,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
fLink.Attach<BRect>(fCurrentLayer->Bounds());
|
||||
fLink.Flush();
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
break;
|
||||
}
|
||||
case AS_LAYER_SET_ORIGIN:
|
||||
@ -1723,9 +1723,9 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
}
|
||||
|
||||
default:
|
||||
if (fDesktop->ReadLockWindows()) {
|
||||
if (fDesktop->LockSingleWindow()) {
|
||||
_DispatchViewDrawingMessage(code, link);
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -2168,9 +2168,9 @@ ServerWindow::_MessageLooper()
|
||||
if (!fWindowLayer->IsHidden())
|
||||
CRITICAL("ServerWindow: a window must be hidden before it's deleted\n");
|
||||
} else {
|
||||
fDesktop->ReadLockWindows();
|
||||
fDesktop->LockSingleWindow();
|
||||
_DispatchMessage(code, receiver);
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
|
||||
#ifdef PROFILE_MESSAGE_LOOP
|
||||
@ -2272,7 +2272,7 @@ ServerWindow::HandleDirectConnection(int32 bufferState, int32 driverState)
|
||||
|| (!fDirectWindowData->started
|
||||
&& (bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_START))
|
||||
return;
|
||||
printf("bufferState = %ld\n", bufferState);
|
||||
|
||||
fDirectWindowData->started = true;
|
||||
|
||||
if (bufferState != -1)
|
||||
|
@ -60,7 +60,7 @@
|
||||
// the update session, which tells us the cause of the update
|
||||
#define DELAYED_BACKGROUND_CLEARING 0
|
||||
|
||||
// IMPORTANT: nested ReadLockWindows()s are not supported (by MultiLocker)
|
||||
// IMPORTANT: nested LockSingleWindow()s are not supported (by MultiLocker)
|
||||
|
||||
using std::nothrow;
|
||||
|
||||
@ -169,7 +169,7 @@ bool
|
||||
WindowLayer::ReadLockWindows()
|
||||
{
|
||||
if (fDesktop)
|
||||
fReadLocked = fDesktop->ReadLockWindows();
|
||||
fReadLocked = fDesktop->LockSingleWindow();
|
||||
else
|
||||
fReadLocked = true;
|
||||
|
||||
@ -182,7 +182,7 @@ WindowLayer::ReadUnlockWindows()
|
||||
{
|
||||
if (fReadLocked) {
|
||||
if (fDesktop)
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
fReadLocked = false;
|
||||
}
|
||||
}
|
||||
@ -425,13 +425,13 @@ WindowLayer::ScrollViewBy(ViewLayer* view, int32 dx, int32 dy)
|
||||
if (!view || view == fTopLayer || (dx == 0 && dy == 0))
|
||||
return;
|
||||
|
||||
if (fDesktop && fDesktop->ReadLockWindows()) {
|
||||
if (fDesktop && fDesktop->LockSingleWindow()) {
|
||||
BRegion dirty;
|
||||
view->ScrollBy(dx, dy, &dirty);
|
||||
|
||||
MarkContentDirty(dirty);
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@ -440,7 +440,7 @@ WindowLayer::ScrollViewBy(ViewLayer* view, int32 dx, int32 dy)
|
||||
void
|
||||
WindowLayer::CopyContents(BRegion* region, int32 xOffset, int32 yOffset)
|
||||
{
|
||||
if (!fHidden && fDesktop && fDesktop->ReadLockWindows()) {
|
||||
if (!fHidden && fDesktop && fDesktop->LockSingleWindow()) {
|
||||
BRegion newDirty(*region);
|
||||
|
||||
// clip the region to the visible contents at the
|
||||
@ -496,7 +496,7 @@ WindowLayer::CopyContents(BRegion* region, int32 xOffset, int32 yOffset)
|
||||
if (newDirty.CountRects() > 0)
|
||||
ProcessDirtyRegion(newDirty);
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@ -635,7 +635,7 @@ WindowLayer::ProcessDirtyRegion(BRegion& region)
|
||||
void
|
||||
WindowLayer::RedrawDirtyRegion()
|
||||
{
|
||||
if (!fDesktop || !fDesktop->ReadLockWindows())
|
||||
if (!fDesktop || !fDesktop->LockSingleWindow())
|
||||
return;
|
||||
|
||||
if (IsVisible()) {
|
||||
@ -652,7 +652,7 @@ WindowLayer::RedrawDirtyRegion()
|
||||
// read lock for the whole time.
|
||||
fDirtyRegion.MakeEmpty();
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
|
||||
|
||||
@ -675,11 +675,11 @@ WindowLayer::MarkContentDirty(BRegion& regionOnScreen)
|
||||
// since this won't affect other windows, read locking
|
||||
// is sufficient. If there was no dirty region before,
|
||||
// an update message is triggered
|
||||
if (!fHidden && fDesktop && fDesktop->ReadLockWindows()) {
|
||||
if (!fHidden && fDesktop && fDesktop->LockSingleWindow()) {
|
||||
regionOnScreen.IntersectWith(&VisibleContentRegion());
|
||||
ProcessDirtyRegion(regionOnScreen);
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@ -687,9 +687,9 @@ WindowLayer::MarkContentDirty(BRegion& regionOnScreen)
|
||||
void
|
||||
WindowLayer::InvalidateView(ViewLayer* layer, BRegion& layerRegion)
|
||||
{
|
||||
if (layer && !fHidden && fDesktop && fDesktop->ReadLockWindows()) {
|
||||
if (layer && !fHidden && fDesktop && fDesktop->LockSingleWindow()) {
|
||||
if (!layer->IsVisible()) {
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
return;
|
||||
}
|
||||
if (!fContentRegionValid)
|
||||
@ -702,7 +702,7 @@ WindowLayer::InvalidateView(ViewLayer* layer, BRegion& layerRegion)
|
||||
// properly cleared in _TriggerContentRedraw()
|
||||
MarkContentDirty(layerRegion);
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1653,7 +1653,7 @@ WindowLayer::BeginUpdate()
|
||||
// on the global clipping lock so that the internal
|
||||
// dirty regions are not messed with from the Desktop thread
|
||||
// and ServerWindow thread at the same time.
|
||||
if (!fDesktop->ReadLockWindows())
|
||||
if (!fDesktop->LockSingleWindow())
|
||||
return;
|
||||
|
||||
if (fUpdateRequested && fCurrentUpdateSession.IsUsed()) {
|
||||
@ -1664,7 +1664,7 @@ WindowLayer::BeginUpdate()
|
||||
fEffectiveDrawingRegionValid = false;
|
||||
}
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
|
||||
|
||||
@ -1672,7 +1672,7 @@ void
|
||||
WindowLayer::EndUpdate()
|
||||
{
|
||||
// NOTE: see comment in _BeginUpdate()
|
||||
if (!fDesktop->ReadLockWindows())
|
||||
if (!fDesktop->LockSingleWindow())
|
||||
return;
|
||||
|
||||
if (fInUpdate) {
|
||||
@ -1688,7 +1688,7 @@ WindowLayer::EndUpdate()
|
||||
fUpdateRequested = false;
|
||||
}
|
||||
|
||||
fDesktop->ReadUnlockWindows();
|
||||
fDesktop->UnlockSingleWindow();
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,14 +72,14 @@ Workspace::Workspace(Desktop& desktop, int32 index)
|
||||
fDesktop(desktop),
|
||||
fCurrentWorkspace(index == desktop.CurrentWorkspace())
|
||||
{
|
||||
fDesktop.ReadLockWindows();
|
||||
fDesktop.LockSingleWindow();
|
||||
RewindWindows();
|
||||
}
|
||||
|
||||
|
||||
Workspace::~Workspace()
|
||||
{
|
||||
fDesktop.ReadUnlockWindows();
|
||||
fDesktop.UnlockSingleWindow();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user