Merge pull request #197 from atong-tcs/master

xfreerdp: handle -g X%
This commit is contained in:
Otavio Salvador 2011-11-02 09:53:29 -07:00
commit cb0cf99099
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)