Removing subset windows works now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11907 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2005-03-18 19:00:45 +00:00
parent a7779c5ae0
commit 48e72f82e6
3 changed files with 28 additions and 12 deletions

View File

@ -343,16 +343,18 @@ void Desktop::RemoveWinBorder(WinBorder *winBorder)
return;
}
// unlock!
Unlock();
// Tell to winBorder's RootLayer about this.
ActiveRootLayer()->RemoveWinBorder(winBorder);
// unlock!
Unlock();
}
void Desktop::AddWinBorderToSubset(WinBorder *winBorder, WinBorder *toWinBorder)
{
// NOTE: we can safely lock the entire method body, because this method is called from
// RootLayer's thread only.
// we're playing with window list. lock first.
Lock();
@ -380,15 +382,18 @@ void Desktop::AddWinBorderToSubset(WinBorder *winBorder, WinBorder *toWinBorder)
return;
}
// hey, unlock!
Unlock();
// send WinBorder to be added to workspaces, if not already in there.
ActiveRootLayer()->AddSubsetWinBorder(winBorder, toWinBorder);
// hey, unlock!
Unlock();
}
void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWinBorder)
{
// NOTE: we can safely lock the entire method body, because this method is called from
// RootLayer's thread only.
// we're playing with window list. lock first.
Lock();
@ -400,6 +405,9 @@ void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWin
return;
}
// remove WinBorder from workspace, if needed - some other windows may still have it in their subset
ActiveRootLayer()->RemoveSubsetWinBorder(winBorder, fromWinBorder);
if (fromWinBorder->Window()->Feel() == B_NORMAL_WINDOW_FEEL)
{
//remove from this normal_window's subset.
@ -414,9 +422,6 @@ void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWin
// hey, unlock!
Unlock();
// remove WinBorder from workspace, if needed - some other windows may still have it in their subset
ActiveRootLayer()->RemoveSubsetWinBorder(winBorder, fromWinBorder);
}
inline

View File

@ -262,6 +262,15 @@ int32 RootLayer::WorkingThread(void *data)
desktop->AddWinBorderToSubset(winBorder, toWinBorder);
break;
}
case AS_ROOTLAYER_REMOVE_FROM_SUBSET:
{
WinBorder *winBorder = NULL;
WinBorder *fromWinBorder = NULL;
messageQueue.Read<WinBorder*>(&winBorder);
messageQueue.Read<WinBorder*>(&fromWinBorder);
desktop->RemoveWinBorderFromSubset(winBorder, fromWinBorder);
break;
}
default:
STRACE(("RootLayer(%s)::WorkingThread received unexpected code %lx\n",oneRootLayer->GetName(), code));
break;

View File

@ -1480,8 +1480,6 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
int32 mainToken;
team_id teamID;
printf("ServerWindow %s: Message AS_REM_FROM_SUBSET UNIMPLEMENTED\n",fTitle.String());
link.Read<int32>(&mainToken);
link.Read(&teamID, sizeof(team_id));
@ -1491,7 +1489,11 @@ printf("ServerWindow %s: Message AS_REM_FROM_SUBSET UNIMPLEMENTED\n",fTitle.Stri
fMsgSender->StartMessage(SERVER_TRUE);
fMsgSender->Flush();
// fWinBorder->RemoveFromSubsetOf(wb);
BPortLink msg(-1, -1);
msg.StartMessage(AS_ROOTLAYER_REMOVE_FROM_SUBSET);
msg.Attach<WinBorder*>(fWinBorder);
msg.Attach<WinBorder*>(wb);
fWinBorder->GetRootLayer()->EnqueueMessage(msg);
}
else
{