CVS: rdesktop rdesktop.c,1.123,1.124 xwin.c,1.188,1.189
Michael Gernoth <[email protected]>
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/rdesktop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7344 Modified Files: rdesktop.c xwin.c Log Message: Window-placement patch by <[email protected]> small modifications by me, to only set the PPosition sizehint, if the position was specified on the command-line Index: rdesktop.c =================================================================== RCS file: /cvsroot/rdesktop/rdesktop/rdesktop.c,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** rdesktop.c 13 Mar 2005 17:40:51 -0000 1.123 --- rdesktop.c 23 Mar 2005 12:25:54 -0000 1.124 *************** *** 61,64 **** --- 61,68 ---- int g_xpos = 0; int g_ypos = 0; + int g_pos = 0; /* 0 position unspecified, + 1 specified, + 2 xpos neg, + 4 ypos neg */ extern int g_tcp_port_rdp; int g_server_bpp = 8; *************** *** 482,489 **** --- 486,499 ---- if (*p == '+' || *p == '-') + { + g_pos |= (*p == '-') ? 2 : 1; g_xpos = strtol(p, &p, 10); + } if (*p == '+' || *p == '-') + { + g_pos |= (*p == '-') ? 4 : 1; g_ypos = strtol(p, NULL, 10); + } break; Index: xwin.c =================================================================== RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v retrieving revision 1.188 retrieving revision 1.189 diff -C2 -d -r1.188 -r1.189 *** xwin.c 10 Mar 2005 22:48:15 -0000 1.188 --- xwin.c 23 Mar 2005 12:25:54 -0000 1.189 *************** *** 33,36 **** --- 33,37 ---- extern int g_xpos; extern int g_ypos; + extern int g_pos; extern BOOL g_sendmotion; extern BOOL g_fullscreen; *************** *** 1164,1167 **** --- 1165,1174 ---- wndheight = g_fullscreen ? HeightOfScreen(g_screen) : g_height; + /* Handle -x-y portion of geometry string */ + if (g_xpos < 0 || (g_xpos == 0 && (g_pos & 2))) + g_xpos = WidthOfScreen(g_screen) + g_xpos - g_width; + if (g_ypos < 0 || (g_ypos == 0 && (g_pos & 4))) + g_ypos = HeightOfScreen(g_screen) + g_ypos - g_height; + attribs.background_pixel = BlackPixelOfScreen(g_screen); attribs.border_pixel = WhitePixelOfScreen(g_screen); *************** *** 1207,1210 **** --- 1214,1219 ---- { sizehints->flags = PMinSize | PMaxSize; + if (g_pos) + sizehints->flags |= PPosition; sizehints->min_width = sizehints->max_width = g_width; sizehints->min_height = sizehints->max_height = g_height; ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click