From cdb351d4a49f37ad47fbf01a6e44f8541da245d4 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Thu, 4 Aug 2011 22:35:27 +0000 Subject: [PATCH] When activating a window also bring all windows in the stack to the front layer. I used the ActivateWindow method because there is some magic involved when changing the layer position, utilising this method seems to be a safe way to do it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42577 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 12 +++++++++++- src/servers/app/Desktop.h | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 2cc554f0e0..8c04962bc8 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -1036,11 +1036,21 @@ Desktop::SelectWindow(Window* window) of their subset. */ void -Desktop::ActivateWindow(Window* window) +Desktop::ActivateWindow(Window* window, bool activateStack) { STRACE(("ActivateWindow(%p, %s)\n", window, window ? window->Title() : "")); + WindowStack* stack = window->GetWindowStack(); + if (activateStack && stack != NULL) { + for (int32 i = 0; i < stack->CountWindows(); i++) { + Window* win = stack->LayerOrder().ItemAt(i); + if (window == win) + continue; + ActivateWindow(win, false); + } + } + if (window == NULL) { fBack = NULL; fFront = NULL; diff --git a/src/servers/app/Desktop.h b/src/servers/app/Desktop.h index c3682e9a45..033a50e8a1 100644 --- a/src/servers/app/Desktop.h +++ b/src/servers/app/Desktop.h @@ -160,7 +160,8 @@ public: // Window methods void SelectWindow(Window* window); - void ActivateWindow(Window* window); + void ActivateWindow(Window* window, + bool activateStack = true); void SendWindowBehind(Window* window, Window* behindOf = NULL);