From 3140824be37ee4f02adbb235209015ea796233f0 Mon Sep 17 00:00:00 2001 From: remijouannet Date: Tue, 24 May 2016 17:47:03 +0200 Subject: [PATCH] -g 70%x90% --- doc/rdesktop.1 | 2 +- rdesktop.c | 9 ++++++++- xwin.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/rdesktop.1 b/doc/rdesktop.1 index f6c5207..709fbec 100644 --- a/doc/rdesktop.1 +++ b/doc/rdesktop.1 @@ -66,7 +66,7 @@ so its use is discouraged. Desktop geometry (WxH). If geometry is the special word "workarea", the geometry will be fetched from the extended window manager hints property _NET_WORKAREA, from the root window. The geometry can also be specified as a percentage of the whole -screen, e.g. "-g 80%". +screen, e.g. "-g 80%", "-g 80%x70%". If the specified geometry depends on the screen size, and the screen size is changed, rdesktop will automatically reconnect using the new diff --git a/rdesktop.c b/rdesktop.c index 3730ce6..a7b6361 100644 --- a/rdesktop.c +++ b/rdesktop.c @@ -682,7 +682,14 @@ main(int argc, char *argv[]) if (*p == '%') { g_sizeopt = -g_width; - g_width = 800; + g_width = g_sizeopt; + + if (*(p + 1) == 'x'){ + g_height = -strtol(p + 2, &p, 10); + }else{ + g_height = g_sizeopt; + } + p++; } diff --git a/xwin.c b/xwin.c index 5826b23..cb53e0e 100644 --- a/xwin.c +++ b/xwin.c @@ -1953,8 +1953,8 @@ ui_init_connection(void) /* Percent of screen */ if (-g_sizeopt >= 100) g_using_full_workarea = True; - g_height = HeightOfScreen(g_screen) * (-g_sizeopt) / 100; - g_width = WidthOfScreen(g_screen) * (-g_sizeopt) / 100; + g_height = HeightOfScreen(g_screen) * (-g_height) / 100; + g_width = WidthOfScreen(g_screen) * (-g_width) / 100; } else if (g_sizeopt == 1) {