Merge pull request #42 from remijouannet/master

Add support to specify percentage for both with and height as geomoetry
This commit is contained in:
Henrik Andersson 2016-06-16 16:21:07 +02:00 committed by GitHub
commit 44df869e70
6 changed files with 20 additions and 10 deletions

View File

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

View File

@ -682,7 +682,17 @@ 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++;
}
@ -1166,7 +1176,7 @@ main(int argc, char *argv[])
continue;
}
/* By setting encryption to False here, we have an encrypted login
/* By setting encryption to False here, we have an encrypted login
packet but unencrypted transfer of other packets */
if (!g_packet_encryption)
g_encryption_initial = g_encryption = False;
@ -1740,7 +1750,7 @@ save_licence(unsigned char *data, int length)
sec_hash_sha1_16(ho, hi, g_static_rdesktop_salt_16);
sec_hash_to_string(hash, sizeof(hash), ho, sizeof(ho));
/* write licence to {sha1}.cal.new, then atomically
/* write licence to {sha1}.cal.new, then atomically
rename to {sha1}.cal */
snprintf(path, PATH_MAX, "%s" RDESKTOP_LICENSE_STORE "/%s.cal", home, hash);
path[sizeof(path) - 1] = '\0';

View File

@ -264,7 +264,7 @@ sgi_play(void)
return;
packet = rdpsnd_queue_current_packet();
out = (STREAM)(void *)&(packet->s);
out = (STREAM) (void *) &(packet->s);
len = out->end - out->p;

View File

@ -1180,7 +1180,7 @@ TS_SCardGetStatusChange(STREAM in, STREAM out, RD_BOOL wide)
but is by Windows PCSC spec. used for polling current state.
*/
if (dwTimeout == 0)
dwTimeout = 1;
dwTimeout = 1;
rv = SCardGetStatusChange(myHContext, (MYPCSC_DWORD) dwTimeout,
myRsArray, (MYPCSC_DWORD) dwCount);
copyReaderState_MyPCSCToServer(myRsArray, rsArray, (MYPCSC_DWORD) dwCount);

View File

@ -549,8 +549,8 @@ seamless_send_persistent(RD_BOOL enable)
unsigned int res;
if (!g_seamless_rdp)
return (unsigned int) -1;
printf("%s persistent seamless mode.\n", enable?"Enable":"Disable");
printf("%s persistent seamless mode.\n", enable ? "Enable" : "Disable");
res = seamless_send("PERSISTENT", "%d", enable);
return res;
}

4
xwin.c
View File

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