diff --git a/client/common/cmdline.c b/client/common/cmdline.c index b75357089..f2785360a 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -48,7 +48,7 @@ COMMAND_LINE_ARGUMENT_A args[] = { "kbd-subtype", COMMAND_LINE_VALUE_REQUIRED, "<subtype id>", NULL, NULL, -1, NULL, "Keyboard subtype" }, { "kbd-fn-key", COMMAND_LINE_VALUE_REQUIRED, "<function key count>", NULL, NULL, -1, NULL, "Keyboard function key count" }, { "admin", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "console", "Admin (or console) session" }, - { "multimon", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Multi-monitor" }, + { "multimon", COMMAND_LINE_VALUE_OPTIONAL, NULL, NULL, NULL, -1, NULL, "Multi-monitor" }, { "workarea", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Work area" }, { "t", COMMAND_LINE_VALUE_REQUIRED, "<title>", NULL, NULL, -1, "title", "Window title" }, { "decorations", COMMAND_LINE_VALUE_BOOL, NULL, NULL, BoolValueTrue, -1, NULL, "Window decorations" }, @@ -863,6 +863,22 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin { settings->Fullscreen = TRUE; } + CommandLineSwitchCase(arg, "span") + { + settings->SpanMonitors = TRUE; + } + CommandLineSwitchCase(arg, "multimon") + { + settings->UseMultimon = TRUE; + + if (arg->Flags & COMMAND_LINE_VALUE_PRESENT) + { + if (_stricmp(arg->Value, "force") == 0) + { + settings->ForceMultimon = TRUE; + } + } + } CommandLineSwitchCase(arg, "workarea") { settings->Workarea = TRUE; diff --git a/client/common/file.c b/client/common/file.c index d417f3388..0b5cff085 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -561,6 +561,11 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* if (~((size_t) file->RemoteApplicationCmdLine)) settings->RemoteApplicationCmdLine = file->RemoteApplicationCmdLine; + if (~file->SpanMonitors) + settings->SpanMonitors = file->SpanMonitors; + if (~file->UseMultiMon) + settings->UseMultimon = file->UseMultiMon; + return TRUE; } diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 927db6302..87606bd56 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -521,7 +521,10 @@ struct rdp_settings ALIGN64 int MonitorCount; /* 384 */ ALIGN64 UINT32 MonitorDefArraySize; /* 385 */ ALIGN64 rdpMonitor* MonitorDefArray; /* 386 */ - UINT64 padding0448[448 - 387]; /* 387 */ + ALIGN64 BOOL SpanMonitors; /* 387 */ + ALIGN64 BOOL UseMultimon; /* 388 */ + ALIGN64 BOOL ForceMultimon; /* 389 */ + UINT64 padding0448[448 - 390]; /* 390 */ /* Client Message Channel Data */ UINT64 padding0512[512 - 448]; /* 448 */ diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index 00fac7722..2f7615a28 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -364,8 +364,26 @@ void gcc_write_client_data_blocks(STREAM* s, rdpSettings* settings) /* extended client data supported */ - if (settings->NegotiationFlags) - gcc_write_client_monitor_data(s, settings); + if (settings->NegotiationFlags & EXTENDED_CLIENT_DATA_SUPPORTED) + { + if (!settings->SpanMonitors) + { + gcc_write_client_monitor_data(s, settings); + } + } + else + { + if (settings->UseMultimon) + { + printf("WARNING: true multi monitor support was not advertised by server!\n"); + + if (settings->ForceMultimon) + { + printf("Sending multi monitor information anyway (may break connectivity!)\n"); + gcc_write_client_monitor_data(s, settings); + } + } + } } BOOL gcc_read_server_data_blocks(STREAM* s, rdpSettings* settings, int length) diff --git a/libfreerdp/core/nego.h b/libfreerdp/core/nego.h index 449f2509b..5b9c31079 100644 --- a/libfreerdp/core/nego.h +++ b/libfreerdp/core/nego.h @@ -72,6 +72,8 @@ enum RDP_NEG_MSG }; #define EXTENDED_CLIENT_DATA_SUPPORTED 0x01 +#define DYNVC_GFX_PROTOCOL_SUPPORTED 0x02 +#define RDP_NEGRSP_RESERVED 0x04 #define PRECONNECTION_PDU_V1_SIZE 16 #define PRECONNECTION_PDU_V2_MIN_SIZE (PRECONNECTION_PDU_V1_SIZE + 2)