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
+14 -9
View File
@@ -343,16 +343,18 @@ void Desktop::RemoveWinBorder(WinBorder *winBorder)
return; return;
} }
// unlock!
Unlock();
// Tell to winBorder's RootLayer about this. // Tell to winBorder's RootLayer about this.
ActiveRootLayer()->RemoveWinBorder(winBorder); ActiveRootLayer()->RemoveWinBorder(winBorder);
// unlock!
Unlock();
} }
void Desktop::AddWinBorderToSubset(WinBorder *winBorder, WinBorder *toWinBorder) 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. // we're playing with window list. lock first.
Lock(); Lock();
@@ -380,15 +382,18 @@ void Desktop::AddWinBorderToSubset(WinBorder *winBorder, WinBorder *toWinBorder)
return; return;
} }
// hey, unlock!
Unlock();
// send WinBorder to be added to workspaces, if not already in there. // send WinBorder to be added to workspaces, if not already in there.
ActiveRootLayer()->AddSubsetWinBorder(winBorder, toWinBorder); ActiveRootLayer()->AddSubsetWinBorder(winBorder, toWinBorder);
// hey, unlock!
Unlock();
} }
void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWinBorder) 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. // we're playing with window list. lock first.
Lock(); Lock();
@@ -400,6 +405,9 @@ void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWin
return; 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) if (fromWinBorder->Window()->Feel() == B_NORMAL_WINDOW_FEEL)
{ {
//remove from this normal_window's subset. //remove from this normal_window's subset.
@@ -414,9 +422,6 @@ void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWin
// hey, unlock! // hey, unlock!
Unlock(); Unlock();
// remove WinBorder from workspace, if needed - some other windows may still have it in their subset
ActiveRootLayer()->RemoveSubsetWinBorder(winBorder, fromWinBorder);
} }
inline inline
+9
View File
@@ -262,6 +262,15 @@ int32 RootLayer::WorkingThread(void *data)
desktop->AddWinBorderToSubset(winBorder, toWinBorder); desktop->AddWinBorderToSubset(winBorder, toWinBorder);
break; 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: default:
STRACE(("RootLayer(%s)::WorkingThread received unexpected code %lx\n",oneRootLayer->GetName(), code)); STRACE(("RootLayer(%s)::WorkingThread received unexpected code %lx\n",oneRootLayer->GetName(), code));
break; break;
+5 -3
View File
@@ -1480,8 +1480,6 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
int32 mainToken; int32 mainToken;
team_id teamID; team_id teamID;
printf("ServerWindow %s: Message AS_REM_FROM_SUBSET UNIMPLEMENTED\n",fTitle.String());
link.Read<int32>(&mainToken); link.Read<int32>(&mainToken);
link.Read(&teamID, sizeof(team_id)); 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->StartMessage(SERVER_TRUE);
fMsgSender->Flush(); 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 else
{ {