add support for specifying the window-position with the -g parameter

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@799 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Michael Gernoth 2004-11-18 11:18:49 +00:00
parent 7e432258e6
commit 12623c1e10
2 changed files with 15 additions and 2 deletions

View File

@ -49,6 +49,8 @@ int g_width = 800; /* width is special: If 0, the
absolute value specifies the
percent of the whole screen. */
int g_height = 600;
int g_xpos = 0;
int g_ypos = 0;
extern int g_tcp_port_rdp;
int g_server_bpp = 8;
int g_win_button_size = 0; /* If zero, disable single app mode */
@ -439,7 +441,7 @@ main(int argc, char *argv[])
}
if (*p == 'x')
g_height = strtol(p + 1, NULL, 10);
g_height = strtol(p + 1, &p, 10);
if (g_height <= 0)
{
@ -448,7 +450,16 @@ main(int argc, char *argv[])
}
if (*p == '%')
{
g_width = -g_width;
p++;
}
if (*p == '+' || *p == '-')
g_xpos = strtol(p, &p, 10);
if (*p == '+' || *p == '-')
g_ypos = strtol(p, NULL, 10);
break;

4
xwin.c
View File

@ -30,6 +30,8 @@
extern int g_width;
extern int g_height;
extern int g_xpos;
extern int g_ypos;
extern BOOL g_sendmotion;
extern BOOL g_fullscreen;
extern BOOL g_grab_keyboard;
@ -964,7 +966,7 @@ ui_create_window(void)
attribs.override_redirect = g_fullscreen;
attribs.colormap = g_xcolmap;
g_wnd = XCreateWindow(g_display, RootWindowOfScreen(g_screen), 0, 0, wndwidth, wndheight,
g_wnd = XCreateWindow(g_display, RootWindowOfScreen(g_screen), g_xpos, g_ypos, wndwidth, wndheight,
0, g_depth, InputOutput, g_visual,
CWBackPixel | CWBackingStore | CWOverrideRedirect |
CWColormap | CWBorderPixel, &attribs);