mirror of https://github.com/FreeRDP/FreeRDP
xfreerdp: handle -g X%
This commit is contained in:
parent
1820e9ca72
commit
a836faf3ed
|
@ -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;
|
||||
|
|
|
@ -186,6 +186,7 @@ struct rdp_settings
|
|||
|
||||
uint16 width;
|
||||
uint16 height;
|
||||
uint16 percent_screen;
|
||||
boolean sw_gdi;
|
||||
boolean workarea;
|
||||
boolean fullscreen;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue