--- sourceforge.net/trunk/rdesktop/rdesktop.c 2006/03/02 15:22:25 1053 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2006/09/21 19:00:11 1272 @@ -69,7 +69,7 @@ 2 xpos neg, 4 ypos neg */ extern int g_tcp_port_rdp; -int g_server_depth = 8; +int g_server_depth = -1; int g_win_button_size = 0; /* If zero, disable single app mode */ BOOL g_bitmap_compression = True; BOOL g_sendmotion = True; @@ -84,11 +84,13 @@ BOOL g_grab_keyboard = True; BOOL g_hide_decorations = False; BOOL g_use_rdp5 = True; +BOOL g_rdpclip = True; BOOL g_console_session = False; BOOL g_numlock_sync = False; BOOL lspci_enabled = False; BOOL g_owncolmap = False; BOOL g_ownbackstore = True; /* We can't rely on external BackingStore */ +BOOL g_seamless_rdp = False; uint32 g_embed_wnd; uint32 g_rdp5_performanceflags = RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS; @@ -146,6 +148,7 @@ #ifdef HAVE_ICONV fprintf(stderr, " -L: local codepage\n"); #endif + fprintf(stderr, " -A: enable SeamlessRDP mode\n"); fprintf(stderr, " -B: use BackingStore of X-server (if available)\n"); fprintf(stderr, " -e: disable encryption (French TS)\n"); fprintf(stderr, " -E: disable encryption from client to server\n"); @@ -176,8 +179,20 @@ fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); fprintf(stderr, " or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n"); - fprintf(stderr, " '-r sound:[local|off|remote]': enable sound redirection\n"); +#ifdef WITH_RDPSND + fprintf(stderr, + " '-r sound:[local[:driver[:device]]|off|remote]': enable sound redirection\n"); fprintf(stderr, " remote would leave sound on server\n"); + fprintf(stderr, " available drivers for 'local':\n"); + rdpsnd_show_help(); +#endif + fprintf(stderr, + " '-r clipboard:[off|PRIMARYCLIPBOARD|CLIPBOARD]': enable clipboard\n"); + fprintf(stderr, " redirection.\n"); + fprintf(stderr, + " 'PRIMARYCLIPBOARD' looks at both PRIMARY and CLIPBOARD\n"); + fprintf(stderr, " when sending data to server.\n"); + fprintf(stderr, " 'CLIPBOARD' looks at only CLIPBOARD.\n"); fprintf(stderr, " -0: attach to console\n"); fprintf(stderr, " -4: use RDP version 4\n"); fprintf(stderr, " -5: use RDP version 5 (default)\n"); @@ -390,8 +405,10 @@ int c; char *locale = NULL; int username_option = 0; + BOOL geometry_option = False; int run_count = 0; /* Session Directory support */ BOOL continue_connect = True; /* Session Directory support */ + char *rdpsnd_optarg = NULL; #ifdef HAVE_LOCALE_H /* Set locale according to environment */ @@ -416,7 +433,7 @@ #endif while ((c = getopt(argc, argv, - VNCOPT "u:L:d:s:c:p:n:k:g:fbBeEmzCDKS:T:NX:a:x:Pr:045h?")) != -1) + VNCOPT "Au:L:d:s:c:p:n:k:g:fbBeEmzCDKS:T:NX:a:x:Pr:045h?")) != -1) { switch (c) { @@ -434,6 +451,10 @@ break; #endif + case 'A': + g_seamless_rdp = True; + break; + case 'u': STRNCPY(g_username, optarg, sizeof(g_username)); username_option = 1; @@ -484,6 +505,7 @@ break; case 'g': + geometry_option = True; g_fullscreen = False; if (!strcmp(optarg, "workarea")) { @@ -639,7 +661,7 @@ if (*optarg == ':') { - *optarg++; + optarg++; while ((p = next_arg(optarg, ','))) { if (str_startswith(optarg, "remote")) @@ -647,7 +669,12 @@ if (str_startswith(optarg, "local")) #ifdef WITH_RDPSND + { + rdpsnd_optarg = + next_arg(optarg, ':'); g_rdpsnd = True; + } + #else warning("Not compiled with sound support\n"); #endif @@ -697,9 +724,25 @@ g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); strcpy(g_rdpdr_clientname, optarg + 11); } + else if (str_startswith(optarg, "clipboard")) + { + optarg += 9; + + if (*optarg == ':') + { + optarg++; + + if (str_startswith(optarg, "off")) + g_rdpclip = False; + else + cliprdr_set_mode(optarg); + } + else + g_rdpclip = True; + } else { - warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound\n"); + warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound, clipboard\n"); } break; @@ -732,6 +775,43 @@ STRNCPY(server, argv[optind], sizeof(server)); parse_server_and_port(server); + if (g_seamless_rdp) + { + if (g_win_button_size) + { + error("You cannot use -S and -A at the same time\n"); + return 1; + } + g_rdp5_performanceflags &= ~RDP5_NO_FULLWINDOWDRAG; + if (geometry_option) + { + error("You cannot use -g and -A at the same time\n"); + return 1; + } + if (g_fullscreen) + { + error("You cannot use -f and -A at the same time\n"); + return 1; + } + if (g_hide_decorations) + { + error("You cannot use -D and -A at the same time\n"); + return 1; + } + if (g_embed_wnd) + { + error("You cannot use -X and -A at the same time\n"); + return 1; + } + if (!g_use_rdp5) + { + error("You cannot use -4 and -A at the same time\n"); + return 1; + } + g_width = -100; + g_grab_keyboard = False; + } + if (!username_option) { pw = getpwuid(getuid()); @@ -807,7 +887,12 @@ #ifdef WITH_RDPSND if (g_rdpsnd) - rdpsnd_init(); + { + if (!rdpsnd_init(rdpsnd_optarg)) + { + warning("Initializing sound-support failed!\n"); + } + } #endif if (lspci_enabled) @@ -1142,7 +1227,7 @@ while (*(mvp + 1) != (char) 0x00) { *mvp = *(mvp + 1); - *mvp++; + mvp++; } *mvp = (char) 0x00; p = nextval;