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
This commit is contained in:
Clemens Zeidler 2011-08-04 22:35:27 +00:00
parent ac4853b49f
commit cdb351d4a4
2 changed files with 13 additions and 2 deletions

View File

@ -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() : "<none>"));
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;

View File

@ -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);