From b527dedcddbf8e3f0a4301904070120caff6f8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 13 Apr 2006 11:49:42 +0000 Subject: [PATCH] * Changed window hierarchy: menu windows are now always on top, then come modal all windows, and after them floating all windows. This is different from BeOS (where floating all windows are on top of modal all windows), but the way its now seems to be more logical. This fixes bug #453 - there remains a problem with open menus, though, but that has to be solved differently by introducing a new feel. * Also, modal app windows are now blocking floating app windows. * Simplified WindowLayer::Frontmost() and Backmost() a bit, moving more stuff into HasInSubset(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17119 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 2 +- src/servers/app/WindowLayer.cpp | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 68b3d7d9fa..58d3441508 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -987,7 +987,7 @@ Desktop::_UpdateFronts(bool updateFloating) bool Desktop::_WindowHasModal(WindowLayer* window) { - if (window == NULL || window->IsFloating()) + if (window == NULL) return false; for (WindowLayer* modal = fSubsetWindows.FirstWindow(); modal != NULL; diff --git a/src/servers/app/WindowLayer.cpp b/src/servers/app/WindowLayer.cpp index 160099d3cf..0d30904be6 100644 --- a/src/servers/app/WindowLayer.cpp +++ b/src/servers/app/WindowLayer.cpp @@ -1327,10 +1327,9 @@ WindowLayer::Backmost(WindowLayer* window, int32 workspace) if (workspace == -1) workspace = fCurrentWorkspace; + // Desktop windows are always backmost if (fFeel == kDesktopWindowFeel) return NULL; - else if (fFeel == B_FLOATING_ALL_WINDOW_FEEL) - return window ? window : PreviousWindow(workspace); if (window == NULL) window = PreviousWindow(workspace); @@ -1361,7 +1360,8 @@ WindowLayer::Frontmost(WindowLayer* first, int32 workspace) if (fFeel == kDesktopWindowFeel) return first ? first : NextWindow(workspace); - if (fFeel == B_FLOATING_ALL_WINDOW_FEEL || fFeel == kMenuWindowFeel) + // menu windows are always on top + if (fFeel == kMenuWindowFeel) return NULL; if (first == NULL) @@ -1372,9 +1372,8 @@ WindowLayer::Frontmost(WindowLayer* first, int32 workspace) if (window->IsHidden() || window == this) continue; - // no one can be in front of a floating all window - if (window->Feel() == B_FLOATING_ALL_WINDOW_FEEL - || window->Feel() == kMenuWindowFeel) + // no one can be in front of a menu window + if (window->Feel() == kMenuWindowFeel) return window; if (window->HasInSubset(this)) @@ -1402,14 +1401,23 @@ WindowLayer::RemoveFromSubset(WindowLayer* window) bool WindowLayer::HasInSubset(WindowLayer* window) { - if (fFeel == B_MODAL_APP_WINDOW_FEEL && window->Feel() == B_MODAL_ALL_WINDOW_FEEL - || fFeel == B_NORMAL_WINDOW_FEEL - || fFeel == window->Feel()) + if (fFeel == window->Feel() || fFeel == B_NORMAL_WINDOW_FEEL) return false; - if (fFeel == B_FLOATING_ALL_WINDOW_FEEL - || fFeel == B_MODAL_ALL_WINDOW_FEEL) + if (fFeel == kMenuWindowFeel) return true; + if (window->Feel() == kMenuWindowFeel) + return false; + + if (fFeel == B_MODAL_ALL_WINDOW_FEEL) + return true; + if (window->Feel() == B_MODAL_ALL_WINDOW_FEEL) + return false; + + if (fFeel == B_FLOATING_ALL_WINDOW_FEEL) + return true; + if (window->Feel() == B_FLOATING_ALL_WINDOW_FEEL) + return false; if (fFeel == B_FLOATING_APP_WINDOW_FEEL || fFeel == B_MODAL_APP_WINDOW_FEEL)