{app|input}_server: Provide app_server team id to input_server.

For cases where a BMessage is passed by area, the remote team id needs
to be passed into BMessage::_SendMessage() so it can transfer the area
to the target team. It falls back to detecting the port owner if said
information is missing. However, since the input_server owns the port
in this situation, the remote team needs to be specified explicitly.
Add the app_server team id to the input acquire message, so input_server
gets the needed info.

As messages that exceed the pass by area threshold are rather rare in
general and shouldn't happen at all in this situation, this does not
fix any immediate problem.
This commit is contained in:
Michael Lotz
2014-11-01 10:26:38 +01:00
parent a0b6efc8c0
commit 91e3b80197
3 changed files with 11 additions and 1 deletions
+4
View File
@@ -13,6 +13,8 @@
#include <ServerProtocol.h>
#include <shared_cursor_area.h>
#include <AppMisc.h>
#include <new>
#include <stdio.h>
#include <string.h>
@@ -53,6 +55,8 @@ InputServerStream::InputServerStream(BMessenger& messenger)
fLatestMouseMoved(NULL)
{
BMessage message(IS_ACQUIRE_INPUT);
message.AddInt32("remote team", BPrivate::current_team());
fCursorArea = create_area("shared cursor", (void **)&fCursorBuffer, B_ANY_ADDRESS,
B_PAGE_SIZE, B_LAZY_LOCK, B_READ_AREA | B_WRITE_AREA);
if (fCursorArea >= B_OK)
+6 -1
View File
@@ -153,6 +153,7 @@ InputServer::InputServer()
fInputMethodAware(false),
fCursorSem(-1),
fAppServerPort(-1),
fAppServerTeam(-1),
fCursorArea(-1)
{
CALLED();
@@ -394,6 +395,9 @@ InputServer::_AcquireInput(BMessage& message, BMessage& reply)
}
}
if (message.FindInt32("remote team", &fAppServerTeam) != B_OK)
fAppServerTeam = -1;
fAppServerPort = create_port(200, "input server target");
if (fAppServerPort < B_OK) {
_ReleaseInput(&message);
@@ -1836,7 +1840,8 @@ InputServer::_DispatchEvent(BMessage* event)
BMessenger reply;
BMessage::Private messagePrivate(event);
return messagePrivate.SendMessage(fAppServerPort, -1, 0, 0, false, reply);
return messagePrivate.SendMessage(fAppServerPort, fAppServerTeam, 0, 0,
false, reply);
}
+1
View File
@@ -243,6 +243,7 @@ class InputServer : public BApplication {
sem_id fCursorSem;
port_id fAppServerPort;
team_id fAppServerTeam;
area_id fCursorArea;
shared_cursor* fCursorBuffer;
};