From 691749c0a3ed74a009dde0b9dc8f9170cedd1325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 5 Aug 2010 11:06:10 +0000 Subject: [PATCH] * Changed mouse down behavior for all mouse modes while dragging a window: now a second click on the right mouse button will raise the window again. * Desktop::SendWindowBehind() now locks a bit earlier, as some of the things it did shouln't really be done without holding a lock (depending from where it was called). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37922 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/DefaultWindowBehaviour.cpp | 9 ++++++--- src/servers/app/Desktop.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/servers/app/DefaultWindowBehaviour.cpp b/src/servers/app/DefaultWindowBehaviour.cpp index 4a92554775..407949e68a 100644 --- a/src/servers/app/DefaultWindowBehaviour.cpp +++ b/src/servers/app/DefaultWindowBehaviour.cpp @@ -167,9 +167,12 @@ DefaultWindowBehaviour::MouseDown(BMessage* message, BPoint where) fWindow->RegionPool()->Recycle(visibleBorder); } - if (action == CLICK_MOVE_TO_BACK) - fDesktop->SendWindowBehind(fWindow); - else { + if (action == CLICK_MOVE_TO_BACK) { + if (!fIsDragging || fWindow != fDesktop->BackWindow()) + fDesktop->SendWindowBehind(fWindow); + else + fDesktop->ActivateWindow(fWindow); + } else { fDesktop->SetMouseEventWindow(fWindow); // activate window if in click to activate mode, else only focus it diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index a1d91dfab2..02366ad9a4 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -1029,13 +1029,17 @@ Desktop::ActivateWindow(Window* window) void Desktop::SendWindowBehind(Window* window, Window* behindOf) { + if (!LockAllWindows()) + return; + // TODO: should the "not in current workspace" be handled anyway? // (the code below would have to be changed then, though) if (window == BackWindow() || !window->InWorkspace(fCurrentWorkspace) - || (behindOf != NULL && !behindOf->InWorkspace(fCurrentWorkspace)) - || !LockAllWindows()) + || (behindOf != NULL && !behindOf->InWorkspace(fCurrentWorkspace))) { + UnlockAllWindows(); return; + } // Is this a valid behindOf window? if (behindOf != NULL && window->HasInSubset(behindOf))