libfreerdp-core: adding more monitor options

This commit is contained in:
Marc-André Moreau 2012-12-13 14:38:02 -05:00
parent 7d8ef00d6a
commit 3e7824f393
5 changed files with 48 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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 */

View File

@ -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)

View File

@ -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)