From 65ff98bb99089674d6327af8491ee6574685ee06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 25 Mar 2014 14:39:21 -0400 Subject: [PATCH] libfreerdp-core: fix /multimon and /span options --- client/common/cmdline.c | 12 ++++++++---- libfreerdp/core/gcc.c | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 3038e88ef..31fc28a6a 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -56,6 +56,7 @@ COMMAND_LINE_ARGUMENT_A args[] = { "pth", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, "pass-the-hash", "Pass the hash (restricted admin mode)" }, { "client-hostname", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Client Hostname to send to server" }, { "multimon", COMMAND_LINE_VALUE_OPTIONAL, NULL, NULL, NULL, -1, NULL, "Use multiple monitors" }, + { "span", COMMAND_LINE_VALUE_OPTIONAL, NULL, NULL, NULL, -1, NULL, "Span screen over multiple monitors" }, { "workarea", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Use available work area" }, { "monitors", COMMAND_LINE_VALUE_REQUIRED, "<0,1,2...>", NULL, NULL, -1, NULL, "Select monitors to use" }, { "monitor-list", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT, NULL, NULL, NULL, -1, NULL, "List detected monitors" }, @@ -1188,13 +1189,10 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, { settings->Fullscreen = TRUE; } - CommandLineSwitchCase(arg, "span") - { - settings->SpanMonitors = TRUE; - } CommandLineSwitchCase(arg, "multimon") { settings->UseMultimon = TRUE; + settings->SpanMonitors = FALSE; settings->Fullscreen = TRUE; if (arg->Flags & COMMAND_LINE_VALUE_PRESENT) @@ -1205,6 +1203,12 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, } } } + CommandLineSwitchCase(arg, "span") + { + settings->UseMultimon = TRUE; + settings->SpanMonitors = TRUE; + settings->Fullscreen = TRUE; + } CommandLineSwitchCase(arg, "workarea") { settings->Workarea = TRUE; diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index ac6950ab2..c7cb18f2f 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -407,16 +407,17 @@ void gcc_write_client_data_blocks(wStream* s, rdpMcs* mcs) if (settings->NegotiationFlags & EXTENDED_CLIENT_DATA_SUPPORTED) { - if (settings->SpanMonitors) + if (settings->UseMultimon && !settings->SpanMonitors) { gcc_write_client_monitor_data(s, mcs); } + gcc_write_client_message_channel_data(s, mcs); gcc_write_client_multitransport_channel_data(s, mcs); } else { - if (settings->UseMultimon) + if (settings->UseMultimon && !settings->SpanMonitors) { fprintf(stderr, "WARNING: true multi monitor support was not advertised by server!\n");