Fixed a bug where a modal app window appeared in current workspace although its workspace mask did not include it

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12462 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca
2005-04-23 10:05:33 +00:00
parent 70208b9153
commit 51a73c1e2b
4 changed files with 49 additions and 15 deletions
+1 -2
View File
@@ -425,7 +425,6 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
if (feel != B_FLOATING_SUBSET_WINDOW_FEEL && feel != B_MODAL_SUBSET_WINDOW_FEEL) if (feel != B_FLOATING_SUBSET_WINDOW_FEEL && feel != B_MODAL_SUBSET_WINDOW_FEEL)
{ {
uint32 wks = winBorder->Workspaces(); uint32 wks = winBorder->Workspaces();
// add to current workspace // add to current workspace
if (wks == 0) if (wks == 0)
{ {
@@ -1777,7 +1776,7 @@ void RootLayer::show_winBorder(WinBorder *winBorder)
// subset modals are a bit like floating windows, they are being added // subset modals are a bit like floating windows, they are being added
// and removed from workspace when there's at least a normal window // and removed from workspace when there's at least a normal window
// that uses them. // that uses them.
winBorder->Level() == B_MODAL_APP || winBorder->Feel() == B_MODAL_SUBSET_WINDOW_FEEL ||
// floating windows are inserted/removed on-the-fly so this window, // floating windows are inserted/removed on-the-fly so this window,
// although needed may not be in workspace's list. // although needed may not be in workspace's list.
winBorder->Level() == B_FLOATING_APP)) winBorder->Level() == B_FLOATING_APP))
+2 -2
View File
@@ -425,6 +425,7 @@ void WinBorder::QuietlySetFeel(int32 feel)
switch (fFeel) switch (fFeel)
{ {
case B_MODAL_APP_WINDOW_FEEL: case B_MODAL_APP_WINDOW_FEEL:
break;
case B_MODAL_SUBSET_WINDOW_FEEL: case B_MODAL_SUBSET_WINDOW_FEEL:
case B_FLOATING_APP_WINDOW_FEEL: case B_FLOATING_APP_WINDOW_FEEL:
case B_FLOATING_SUBSET_WINDOW_FEEL: case B_FLOATING_SUBSET_WINDOW_FEEL:
@@ -437,7 +438,6 @@ void WinBorder::QuietlySetFeel(int32 feel)
fWorkspaces = 0xffffffffUL; fWorkspaces = 0xffffffffUL;
break; break;
case B_NORMAL_WINDOW_FEEL: case B_NORMAL_WINDOW_FEEL:
if (fWorkspaces == 0x0UL) break;
;
} }
} }
+45 -11
View File
@@ -21,7 +21,7 @@
// //
// File Name: Workspace.cpp // File Name: Workspace.cpp
// Author: Adi Oanca <[email protected]> // Author: Adi Oanca <[email protected]>
// Description: Tracks workspaces // Description: Tracks windows inside one workspace
// //
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Notes: IMPORTANT WARNING // Notes: IMPORTANT WARNING
@@ -542,18 +542,36 @@ STRACE(("W(%ld)::HideWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "N
{ {
// if this modal subset is in our list ONLY (not in other visible normal window's one), // if this modal subset is in our list ONLY (not in other visible normal window's one),
// then remove from Workspace's list. // then remove from Workspace's list.
if (item->layerPtr->Level() == B_MODAL_APP if (item->layerPtr->Level() == B_MODAL_APP)
&& winBorder->fFMWList.HasItem(item->layerPtr)
&& !searchFirstMainWindow(item->layerPtr))
{ {
// if this modal subset has front state, make sure another window will get that status. if(winBorder->fFMWList.HasItem(item->layerPtr))
if (fFrontItem == item) {
changeFront = true; if(!searchFirstMainWindow(item->layerPtr))
{
// if this modal subset has front state, make sure another window will get that status.
if (fFrontItem == item)
changeFront = true;
toast = item; toast = item;
item = item->lowerItem; item = item->lowerItem;
RemoveItem(toast); RemoveItem(toast);
fPool.ReleaseMemory(toast); fPool.ReleaseMemory(toast);
}
}
else if (!searchANormalWindow(item->layerPtr)
&& !(item->layerPtr->Workspaces() & (0x00000001 << fID)))
{
// if this modal subset has front state, make sure another window will get that status.
if (fFrontItem == item)
changeFront = true;
toast = item;
item = item->lowerItem;
RemoveItem(toast);
fPool.ReleaseMemory(toast);
}
else
item = item->lowerItem;
} }
else else
item = item->lowerItem; item = item->lowerItem;
@@ -1362,6 +1380,22 @@ bool Workspace::removeAndPlaceBefore(const WinBorder *wb, ListData *beforeItem)
return removeAndPlaceBefore(HasItem(wb), beforeItem); return removeAndPlaceBefore(HasItem(wb), beforeItem);
} }
inline
WinBorder* Workspace::searchANormalWindow(WinBorder *wb) const
{
ListData *listItem = fBottomItem;
while (listItem)
{
if (listItem->layerPtr->Level() == B_NORMAL && !listItem->layerPtr->IsHidden()
&& listItem->layerPtr->App()->ClientTeamID() == wb->App()->ClientTeamID())
return listItem->layerPtr;
listItem = listItem->upperItem;
}
return NULL;
}
inline inline
WinBorder* Workspace::searchFirstMainWindow(WinBorder *wb) const WinBorder* Workspace::searchFirstMainWindow(WinBorder *wb) const
{ {
+1
View File
@@ -102,6 +102,7 @@ private:
bool removeAndPlaceBefore(ListData *item, ListData *beforeItem); bool removeAndPlaceBefore(ListData *item, ListData *beforeItem);
WinBorder* searchFirstMainWindow(WinBorder *wb) const; WinBorder* searchFirstMainWindow(WinBorder *wb) const;
WinBorder* searchANormalWindow(WinBorder *wb) const;
bool windowHasVisibleModals(const WinBorder *winBorder) const; bool windowHasVisibleModals(const WinBorder *winBorder) const;
ListData* putModalsInFront(ListData *item); ListData* putModalsInFront(ListData *item);