Some progress on supporting subset windows.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11711 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -291,13 +291,8 @@ void Desktop::AddWinBorder(WinBorder *winBorder)
|
|||||||
// R2: how to determine the RootLayer to which this window should be added???
|
// R2: how to determine the RootLayer to which this window should be added???
|
||||||
// for now, use ActiveRootLayer() because we only have one instance.
|
// for now, use ActiveRootLayer() because we only have one instance.
|
||||||
|
|
||||||
// these are added to windows's FMWList and Workspaces when
|
|
||||||
// BWindow::AddToSubset() is called. not now.
|
|
||||||
if (feel != B_FLOATING_SUBSET_WINDOW_FEEL && feel != B_MODAL_SUBSET_WINDOW_FEEL)
|
|
||||||
{
|
|
||||||
// send WinBorder to be added to workspaces
|
// send WinBorder to be added to workspaces
|
||||||
ActiveRootLayer()->AddWinBorder(winBorder);
|
ActiveRootLayer()->AddWinBorder(winBorder);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Desktop::RemoveWinBorder(WinBorder *winBorder)
|
void Desktop::RemoveWinBorder(WinBorder *winBorder)
|
||||||
|
|||||||
@@ -253,6 +253,15 @@ int32 RootLayer::WorkingThread(void *data)
|
|||||||
layer->resize_layer(x, y);
|
layer->resize_layer(x, y);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case AS_ROOTLAYER_ADD_TO_SUBSET:
|
||||||
|
{
|
||||||
|
WinBorder *winBorder = NULL;
|
||||||
|
WinBorder *toWinBorder = NULL;
|
||||||
|
messageQueue.Read<WinBorder*>(&winBorder);
|
||||||
|
messageQueue.Read<WinBorder*>(&toWinBorder);
|
||||||
|
desktop->AddWinBorderToSubset(winBorder, toWinBorder);
|
||||||
|
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;
|
||||||
@@ -389,7 +398,11 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
|
|||||||
debugger("RootLayer::RemoveWinBorder - winBorder must be hidden\n");
|
debugger("RootLayer::RemoveWinBorder - winBorder must be hidden\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//printf("Adi: AddWinBorder(%p)\n", winBorder);
|
|
||||||
|
// Subset modals also need to have a main window before appearing in workspace list.
|
||||||
|
int32 feel = winBorder->Window()->Feel();
|
||||||
|
if (feel != B_FLOATING_SUBSET_WINDOW_FEEL && feel != B_MODAL_SUBSET_WINDOW_FEEL)
|
||||||
|
{
|
||||||
uint32 wks = winBorder->Window()->Workspaces();
|
uint32 wks = winBorder->Window()->Workspaces();
|
||||||
|
|
||||||
// add to current workspace
|
// add to current workspace
|
||||||
@@ -406,6 +419,7 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
|
|||||||
fWorkspace[i]->AddWinBorder(winBorder);
|
fWorkspace[i]->AddWinBorder(winBorder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// we _DO_NOT_ need to invalidate here. At this point our WinBorder is hidden!
|
// we _DO_NOT_ need to invalidate here. At this point our WinBorder is hidden!
|
||||||
|
|
||||||
@@ -456,6 +470,7 @@ void RootLayer::AddSubsetWinBorder(WinBorder *winBorder, WinBorder *toWinBorder)
|
|||||||
|
|
||||||
bool invalidate = false;
|
bool invalidate = false;
|
||||||
bool invalid;
|
bool invalid;
|
||||||
|
WinBorder *exFocus = FocusWinBorder();
|
||||||
|
|
||||||
// we try to add WinBorders to all workspaces. If they are not needed, nothing will be done.
|
// we try to add WinBorders to all workspaces. If they are not needed, nothing will be done.
|
||||||
// If they are needed, Workspace automaticaly allocates space and inserts them.
|
// If they are needed, Workspace automaticaly allocates space and inserts them.
|
||||||
@@ -472,7 +487,13 @@ void RootLayer::AddSubsetWinBorder(WinBorder *winBorder, WinBorder *toWinBorder)
|
|||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
{
|
{
|
||||||
// RootLayer::Invalidate(&winborder's full)
|
get_workspace_windows();
|
||||||
|
|
||||||
|
// TODO: should it be improved by calling with region of hidden windows
|
||||||
|
// plus the full regions of new windows???
|
||||||
|
invalidate_layer(this, fFull);
|
||||||
|
|
||||||
|
draw_window_tab(exFocus, FocusWinBorder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,6 +508,7 @@ void RootLayer::RemoveSubsetWinBorder(WinBorder *winBorder, WinBorder *fromWinBo
|
|||||||
|
|
||||||
bool invalidate = false;
|
bool invalidate = false;
|
||||||
bool invalid;
|
bool invalid;
|
||||||
|
WinBorder *exFocus = FocusWinBorder();
|
||||||
|
|
||||||
// we try to remove from all workspaces. If winBorder is not in there, nothing will be done.
|
// we try to remove from all workspaces. If winBorder is not in there, nothing will be done.
|
||||||
for (int32 i = 0; i < fWsCount; i++)
|
for (int32 i = 0; i < fWsCount; i++)
|
||||||
@@ -502,7 +524,13 @@ void RootLayer::RemoveSubsetWinBorder(WinBorder *winBorder, WinBorder *fromWinBo
|
|||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
{
|
{
|
||||||
// RootLayer::Invalidate(&winBorder's visible);
|
get_workspace_windows();
|
||||||
|
|
||||||
|
// TODO: should it be improved by calling with region of hidden windows
|
||||||
|
// plus the full regions of new windows???
|
||||||
|
invalidate_layer(this, fFull);
|
||||||
|
|
||||||
|
draw_window_tab(exFocus, FocusWinBorder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1559,16 +1587,16 @@ void RootLayer::show_winBorder(WinBorder *winBorder)
|
|||||||
invalidate = invalid;
|
invalidate = invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
get_workspace_windows();
|
|
||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
{
|
{
|
||||||
|
get_workspace_windows();
|
||||||
|
|
||||||
// TODO: should it be improved by calling with region of hidden windows
|
// TODO: should it be improved by calling with region of hidden windows
|
||||||
// plus the full regions of new windows???
|
// plus the full regions of new windows???
|
||||||
invalidate_layer(this, fFull);
|
invalidate_layer(this, fFull);
|
||||||
}
|
|
||||||
|
|
||||||
draw_window_tab(exFocus, FocusWinBorder());
|
draw_window_tab(exFocus, FocusWinBorder());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RootLayer::hide_winBorder(WinBorder *winBorder)
|
void RootLayer::hide_winBorder(WinBorder *winBorder)
|
||||||
@@ -1590,16 +1618,16 @@ void RootLayer::hide_winBorder(WinBorder *winBorder)
|
|||||||
invalidate = invalid;
|
invalidate = invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
get_workspace_windows();
|
|
||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
{
|
{
|
||||||
|
get_workspace_windows();
|
||||||
|
|
||||||
// TODO: should it be improved by calling with region of hidden windows
|
// TODO: should it be improved by calling with region of hidden windows
|
||||||
// plus the full regions of new windows???
|
// plus the full regions of new windows???
|
||||||
invalidate_layer(this, fFull);
|
invalidate_layer(this, fFull);
|
||||||
}
|
|
||||||
|
|
||||||
draw_window_tab(exFocus, FocusWinBorder());
|
draw_window_tab(exFocus, FocusWinBorder());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RootLayer::get_workspace_windows()
|
void RootLayer::get_workspace_windows()
|
||||||
|
|||||||
@@ -1454,8 +1454,6 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
int32 mainToken;
|
int32 mainToken;
|
||||||
team_id teamID;
|
team_id teamID;
|
||||||
|
|
||||||
printf("ServerWindow %s: Message AS_ADD_TO_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));
|
||||||
|
|
||||||
@@ -1465,7 +1463,11 @@ printf("ServerWindow %s: Message AS_ADD_TO_SUBSET UNIMPLEMENTED\n",fTitle.String
|
|||||||
fMsgSender->StartMessage(SERVER_TRUE);
|
fMsgSender->StartMessage(SERVER_TRUE);
|
||||||
fMsgSender->Flush();
|
fMsgSender->Flush();
|
||||||
|
|
||||||
// fWinBorder->AddToSubsetOf(wb);
|
BPortLink msg(-1, -1);
|
||||||
|
msg.StartMessage(AS_ROOTLAYER_ADD_TO_SUBSET);
|
||||||
|
msg.Attach<WinBorder*>(fWinBorder);
|
||||||
|
msg.Attach<WinBorder*>(wb);
|
||||||
|
fWinBorder->GetRootLayer()->EnqueueMessage(msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user