[server,shadow] add option to hide mouse cursor

This commit is contained in:
akallabeth
2025-04-10 09:09:30 +02:00
parent 40b162736c
commit 4b2d65e977
4 changed files with 18 additions and 2 deletions

View File

@@ -179,6 +179,7 @@ extern "C"
size_t maxClientsConnected;
BOOL SupportMultiRectBitmapUpdates; /** @since version 3.13.0 */
BOOL ShowMouseCursor; /** @since version 3.14.2 */
};
struct rdp_shadow_surface

View File

@@ -48,6 +48,8 @@ int main(int argc, char** argv)
NULL, NULL, -1, NULL,
"An address to bind to. Use '[<ipv6>]' for IPv6 addresses, e.g. '[::1]' for "
"localhost" },
{ "server-side-cursor", COMMAND_LINE_VALUE_BOOL, NULL, NULL, NULL, -1, NULL,
"hide mouse cursor in RDP client." },
{ "monitors", COMMAND_LINE_VALUE_OPTIONAL, "<0,1,2...>", NULL, NULL, -1, NULL,
"Select or list monitors" },
{ "max-connections", COMMAND_LINE_VALUE_REQUIRED, "<number>", 0, NULL, -1, NULL,
@@ -148,7 +150,7 @@ int main(int argc, char** argv)
if ((status = shadow_server_parse_command_line(server, argc, argv, shadow_args)) < 0)
{
shadow_server_command_line_status_print(server, argc, argv, status, shadow_args);
status = shadow_server_command_line_status_print(server, argc, argv, status, shadow_args);
goto fail;
}

View File

@@ -2179,7 +2179,16 @@ static int shadow_client_subsystem_process_message(rdpShadowClient* client, wMes
if (client->activated)
{
IFCALL(update->pointer->PointerNew, context, &pointerNew);
IFCALL(update->pointer->PointerCached, context, &pointerCached);
if (client->server->ShowMouseCursor)
{
IFCALL(update->pointer->PointerCached, context, &pointerCached);
}
else
{
POINTER_SYSTEM_UPDATE pointer_system = { 0 };
pointer_system.type = SYSPTR_NULL;
IFCALL(update->pointer->PointerSystem, context, &pointer_system);
}
}
break;

View File

@@ -244,6 +244,10 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a
{
server->mayInteract = arg->Value ? TRUE : FALSE;
}
CommandLineSwitchCase(arg, "server-side-cursor")
{
server->ShowMouseCursor = arg->Value ? TRUE : FALSE;
}
CommandLineSwitchCase(arg, "mouse-relative")
{
const BOOL val = arg->Value ? TRUE : FALSE;