* 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:
Axel Dörfler
2005-12-02 16:07:02 +00:00
parent b2d24b66da
commit c072e9f1f5
4 changed files with 35 additions and 43 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ enum {
AS_NEEDS_UPDATE, AS_NEEDS_UPDATE,
AS_SET_WINDOW_TITLE, AS_SET_WINDOW_TITLE,
AS_ADD_TO_SUBSET, AS_ADD_TO_SUBSET,
AS_REM_FROM_SUBSET, AS_REMOVE_FROM_SUBSET,
AS_SET_ALIGNMENT, AS_SET_ALIGNMENT,
AS_GET_ALIGNMENT, AS_GET_ALIGNMENT,
AS_GET_WORKSPACES, AS_GET_WORKSPACES,
+5 -10
View File
@@ -1541,14 +1541,11 @@ BWindow::AddToSubset(BWindow *window)
&& fFeel != B_FLOATING_SUBSET_WINDOW_FEEL)) && fFeel != B_FLOATING_SUBSET_WINDOW_FEEL))
return B_BAD_VALUE; return B_BAD_VALUE;
team_id team = Team();
Lock(); Lock();
fLink->StartMessage(AS_ADD_TO_SUBSET);
fLink->Attach<int32>(_get_object_token_(window));
fLink->Attach<team_id>(team);
status_t status = B_ERROR; status_t status = B_ERROR;
fLink->StartMessage(AS_ADD_TO_SUBSET);
fLink->Attach<int32>(_get_object_token_(window));
fLink->FlushWithReply(status); fLink->FlushWithReply(status);
Unlock(); Unlock();
@@ -1565,15 +1562,13 @@ BWindow::RemoveFromSubset(BWindow *window)
&& fFeel != B_FLOATING_SUBSET_WINDOW_FEEL)) && fFeel != B_FLOATING_SUBSET_WINDOW_FEEL))
return B_BAD_VALUE; return B_BAD_VALUE;
team_id team = Team();
Lock(); Lock();
fLink->StartMessage(AS_REM_FROM_SUBSET);
fLink->Attach<int32>(_get_object_token_(window));
fLink->Attach<team_id>(team);
status_t status = B_ERROR; status_t status = B_ERROR;
fLink->StartMessage(AS_REMOVE_FROM_SUBSET);
fLink->Attach<int32>(_get_object_token_(window));
fLink->FlushWithReply(status); fLink->FlushWithReply(status);
Unlock(); Unlock();
return status; return status;
+29 -31
View File
@@ -1273,45 +1273,43 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
case AS_ADD_TO_SUBSET: case AS_ADD_TO_SUBSET:
{ {
STRACE(("ServerWindow %s: Message AS_ADD_TO_SUBSET\n", Title())); STRACE(("ServerWindow %s: Message AS_ADD_TO_SUBSET\n", Title()));
WindowLayer *windowLayer; status_t status = B_ERROR;
int32 mainToken;
team_id teamID;
link.Read<int32>(&mainToken); int32 token;
link.Read(&teamID, sizeof(team_id)); if (link.Read<int32>(&token) == B_OK) {
WindowLayer* windowLayer = fDesktop->FindWindowLayerByClientToken(
windowLayer = NULL; //fDesktop->FindWindowLayerByClientToken(mainToken, teamID); token, App()->ClientTeam());
if (windowLayer) { if (windowLayer == NULL
fLink.StartMessage(B_OK); || windowLayer->Feel() != B_NORMAL_WINDOW_FEEL) {
fLink.Flush(); status = B_BAD_VALUE;
} else {
//fDesktop->AddWindowLayerToSubset(fWindowLayer, windowLayer); status = fWindowLayer->AddToSubset(windowLayer)
} else { ? B_OK : B_NO_MEMORY;
fLink.StartMessage(B_ERROR); }
fLink.Flush();
} }
fLink.StartMessage(status);
fLink.Flush();
break; break;
} }
case AS_REM_FROM_SUBSET: case AS_REMOVE_FROM_SUBSET:
{ {
STRACE(("ServerWindow %s: Message AS_REM_FROM_SUBSET\n", Title())); STRACE(("ServerWindow %s: Message AS_REM_FROM_SUBSET\n", Title()));
WindowLayer *windowLayer; status_t status = B_ERROR;
int32 mainToken;
team_id teamID;
link.Read<int32>(&mainToken); int32 token;
link.Read(&teamID, sizeof(team_id)); if (link.Read<int32>(&token) == B_OK) {
WindowLayer* windowLayer = fDesktop->FindWindowLayerByClientToken(
windowLayer = NULL; //fDesktop->FindWindowLayerByClientToken(mainToken, teamID); token, App()->ClientTeam());
if (windowLayer) { if (windowLayer != NULL) {
fLink.StartMessage(B_OK); fWindowLayer->RemoveFromSubset(windowLayer);
fLink.Flush(); status = B_OK;
} else
//fDesktop->RemoveWindowLayerFromSubset(fWindowLayer, windowLayer); status = B_BAD_VALUE;
} else {
fLink.StartMessage(B_ERROR);
fLink.Flush();
} }
fLink.StartMessage(status);
fLink.Flush();
break; break;
} }
-1
View File
@@ -812,7 +812,6 @@ WindowLayer::Frontmost(WindowLayer* first)
} }
bool bool
WindowLayer::AddToSubset(WindowLayer* window) WindowLayer::AddToSubset(WindowLayer* window)
{ {