* BWindow::AddToSubset()/RemoveFromSubset() no longer send their team ID; this
is known by the server, anyway. * B_MODAL_SUBSET_WINDOW_FEEL now also works as expected. * Renamed AS_REM_FROM_SUBSET to AS_REMOVE_FROM_SUBSET. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15285 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b2d24b66da
commit
c072e9f1f5
@ -93,7 +93,7 @@ enum {
|
||||
AS_NEEDS_UPDATE,
|
||||
AS_SET_WINDOW_TITLE,
|
||||
AS_ADD_TO_SUBSET,
|
||||
AS_REM_FROM_SUBSET,
|
||||
AS_REMOVE_FROM_SUBSET,
|
||||
AS_SET_ALIGNMENT,
|
||||
AS_GET_ALIGNMENT,
|
||||
AS_GET_WORKSPACES,
|
||||
|
@ -1541,14 +1541,11 @@ BWindow::AddToSubset(BWindow *window)
|
||||
&& fFeel != B_FLOATING_SUBSET_WINDOW_FEEL))
|
||||
return B_BAD_VALUE;
|
||||
|
||||
team_id team = Team();
|
||||
|
||||
Lock();
|
||||
fLink->StartMessage(AS_ADD_TO_SUBSET);
|
||||
fLink->Attach<int32>(_get_object_token_(window));
|
||||
fLink->Attach<team_id>(team);
|
||||
|
||||
status_t status = B_ERROR;
|
||||
fLink->StartMessage(AS_ADD_TO_SUBSET);
|
||||
fLink->Attach<int32>(_get_object_token_(window));
|
||||
fLink->FlushWithReply(status);
|
||||
|
||||
Unlock();
|
||||
@ -1565,15 +1562,13 @@ BWindow::RemoveFromSubset(BWindow *window)
|
||||
&& fFeel != B_FLOATING_SUBSET_WINDOW_FEEL))
|
||||
return B_BAD_VALUE;
|
||||
|
||||
team_id team = Team();
|
||||
|
||||
Lock();
|
||||
fLink->StartMessage(AS_REM_FROM_SUBSET);
|
||||
fLink->Attach<int32>(_get_object_token_(window));
|
||||
fLink->Attach<team_id>(team);
|
||||
|
||||
status_t status = B_ERROR;
|
||||
fLink->StartMessage(AS_REMOVE_FROM_SUBSET);
|
||||
fLink->Attach<int32>(_get_object_token_(window));
|
||||
fLink->FlushWithReply(status);
|
||||
|
||||
Unlock();
|
||||
|
||||
return status;
|
||||
|
@ -1273,45 +1273,43 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||
case AS_ADD_TO_SUBSET:
|
||||
{
|
||||
STRACE(("ServerWindow %s: Message AS_ADD_TO_SUBSET\n", Title()));
|
||||
WindowLayer *windowLayer;
|
||||
int32 mainToken;
|
||||
team_id teamID;
|
||||
status_t status = B_ERROR;
|
||||
|
||||
link.Read<int32>(&mainToken);
|
||||
link.Read(&teamID, sizeof(team_id));
|
||||
|
||||
windowLayer = NULL; //fDesktop->FindWindowLayerByClientToken(mainToken, teamID);
|
||||
if (windowLayer) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Flush();
|
||||
|
||||
//fDesktop->AddWindowLayerToSubset(fWindowLayer, windowLayer);
|
||||
} else {
|
||||
fLink.StartMessage(B_ERROR);
|
||||
fLink.Flush();
|
||||
int32 token;
|
||||
if (link.Read<int32>(&token) == B_OK) {
|
||||
WindowLayer* windowLayer = fDesktop->FindWindowLayerByClientToken(
|
||||
token, App()->ClientTeam());
|
||||
if (windowLayer == NULL
|
||||
|| windowLayer->Feel() != B_NORMAL_WINDOW_FEEL) {
|
||||
status = B_BAD_VALUE;
|
||||
} else {
|
||||
status = fWindowLayer->AddToSubset(windowLayer)
|
||||
? B_OK : B_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
fLink.StartMessage(status);
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
case AS_REM_FROM_SUBSET:
|
||||
case AS_REMOVE_FROM_SUBSET:
|
||||
{
|
||||
STRACE(("ServerWindow %s: Message AS_REM_FROM_SUBSET\n", Title()));
|
||||
WindowLayer *windowLayer;
|
||||
int32 mainToken;
|
||||
team_id teamID;
|
||||
status_t status = B_ERROR;
|
||||
|
||||
link.Read<int32>(&mainToken);
|
||||
link.Read(&teamID, sizeof(team_id));
|
||||
|
||||
windowLayer = NULL; //fDesktop->FindWindowLayerByClientToken(mainToken, teamID);
|
||||
if (windowLayer) {
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Flush();
|
||||
|
||||
//fDesktop->RemoveWindowLayerFromSubset(fWindowLayer, windowLayer);
|
||||
} else {
|
||||
fLink.StartMessage(B_ERROR);
|
||||
fLink.Flush();
|
||||
int32 token;
|
||||
if (link.Read<int32>(&token) == B_OK) {
|
||||
WindowLayer* windowLayer = fDesktop->FindWindowLayerByClientToken(
|
||||
token, App()->ClientTeam());
|
||||
if (windowLayer != NULL) {
|
||||
fWindowLayer->RemoveFromSubset(windowLayer);
|
||||
status = B_OK;
|
||||
} else
|
||||
status = B_BAD_VALUE;
|
||||
}
|
||||
|
||||
fLink.StartMessage(status);
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -812,7 +812,6 @@ WindowLayer::Frontmost(WindowLayer* first)
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool
|
||||
WindowLayer::AddToSubset(WindowLayer* window)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user