xfreerdp: handle -g X%

This commit is contained in:
Anthony Tong 2011-11-01 18:53:49 -05:00
parent 1820e9ca72
commit a836faf3ed
3 changed files with 15 additions and 0 deletions

View File

@ -56,6 +56,11 @@ boolean xf_detect_monitors(xfInfo* xfi, rdpSettings* settings)
settings->width = xfi->workArea.width;
settings->height = xfi->workArea.height;
}
else if (settings->percent_screen)
{
settings->width = (xfi->workArea.width * settings->percent_screen) / 100;
settings->height = (xfi->workArea.height * settings->percent_screen) / 100;
}
if (settings->fullscreen != True && settings->workarea != True)
return True;

View File

@ -186,6 +186,7 @@ struct rdp_settings
uint16 width;
uint16 height;
uint16 percent_screen;
boolean sw_gdi;
boolean workarea;
boolean fullscreen;

View File

@ -184,6 +184,15 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
{
settings->height = (uint16) strtol(p + 1, &p, 10);
}
if (*p == '%')
{
settings->percent_screen = settings->width;
if (settings->percent_screen <= 0 || settings->percent_screen > 100)
{
printf("invalid geometry percentage\n");
return -1;
}
}
else
{
if (ui_callback != NULL)