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:
@@ -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))
|
||||||
|
|||||||
@@ -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;
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,9 +542,11 @@ 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(winBorder->fFMWList.HasItem(item->layerPtr))
|
||||||
|
{
|
||||||
|
if(!searchFirstMainWindow(item->layerPtr))
|
||||||
{
|
{
|
||||||
// if this modal subset has front state, make sure another window will get that status.
|
// if this modal subset has front state, make sure another window will get that status.
|
||||||
if (fFrontItem == item)
|
if (fFrontItem == item)
|
||||||
@@ -555,6 +557,22 @@ STRACE(("W(%ld)::HideWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "N
|
|||||||
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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user