Lines 29-34
Link Here
|
29 |
#include <ctype.h> /* toupper */ |
29 |
#include <ctype.h> /* toupper */ |
30 |
#include <errno.h> |
30 |
#include <errno.h> |
31 |
#include "rdesktop.h" |
31 |
#include "rdesktop.h" |
|
|
32 |
#include "seamless.h" |
32 |
|
33 |
|
33 |
#ifdef HAVE_LOCALE_H |
34 |
#ifdef HAVE_LOCALE_H |
34 |
#include <locale.h> |
35 |
#include <locale.h> |
Lines 91-96
Link Here
|
91 |
BOOL g_owncolmap = False; |
92 |
BOOL g_owncolmap = False; |
92 |
BOOL g_ownbackstore = True; /* We can't rely on external BackingStore */ |
93 |
BOOL g_ownbackstore = True; /* We can't rely on external BackingStore */ |
93 |
BOOL g_seamless_rdp = False; |
94 |
BOOL g_seamless_rdp = False; |
|
|
95 |
|
96 |
/* Master socket identifier */ |
97 |
char *master_socket = NULL; |
98 |
/* Command line to execute in slave mode */ |
99 |
char *slave_cmdline = NULL; |
100 |
|
94 |
uint32 g_embed_wnd; |
101 |
uint32 g_embed_wnd; |
95 |
uint32 g_rdp5_performanceflags = |
102 |
uint32 g_rdp5_performanceflags = |
96 |
RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS; |
103 |
RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | RDP5_NO_MENUANIMATIONS; |
Lines 122-127
Link Here
|
122 |
rdp2vnc_connect(char *server, uint32 flags, char *domain, char *password, |
129 |
rdp2vnc_connect(char *server, uint32 flags, char *domain, char *password, |
123 |
char *shell, char *directory); |
130 |
char *shell, char *directory); |
124 |
#endif |
131 |
#endif |
|
|
132 |
|
133 |
// Send message to rdesktop running in SeamlessrRDP master mode |
134 |
void send_seamless_slave_message(char *cmdline); |
135 |
|
125 |
/* Display usage information */ |
136 |
/* Display usage information */ |
126 |
static void |
137 |
static void |
127 |
usage(char *program) |
138 |
usage(char *program) |
Lines 131-136
Link Here
|
131 |
fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n"); |
142 |
fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n"); |
132 |
|
143 |
|
133 |
fprintf(stderr, "Usage: %s [options] server[:port]\n", program); |
144 |
fprintf(stderr, "Usage: %s [options] server[:port]\n", program); |
|
|
145 |
fprintf(stderr, " %s -l <command> <control socket path>\n", program); |
134 |
#ifdef RDP2VNC |
146 |
#ifdef RDP2VNC |
135 |
fprintf(stderr, " -V: vnc port\n"); |
147 |
fprintf(stderr, " -V: vnc port\n"); |
136 |
fprintf(stderr, " -Q: defer time (ms)\n"); |
148 |
fprintf(stderr, " -Q: defer time (ms)\n"); |
Lines 149-154
Link Here
|
149 |
fprintf(stderr, " -L: local codepage\n"); |
161 |
fprintf(stderr, " -L: local codepage\n"); |
150 |
#endif |
162 |
#endif |
151 |
fprintf(stderr, " -A: enable SeamlessRDP mode\n"); |
163 |
fprintf(stderr, " -A: enable SeamlessRDP mode\n"); |
|
|
164 |
fprintf(stderr, " -M: SeamlessRDP master mode socket path\n"); |
165 |
fprintf(stderr, " -l: <command> <control socket path>: SeamlessRDP slave mode\n"); |
152 |
fprintf(stderr, " -B: use BackingStore of X-server (if available)\n"); |
166 |
fprintf(stderr, " -B: use BackingStore of X-server (if available)\n"); |
153 |
fprintf(stderr, " -e: disable encryption (French TS)\n"); |
167 |
fprintf(stderr, " -e: disable encryption (French TS)\n"); |
154 |
fprintf(stderr, " -E: disable encryption from client to server\n"); |
168 |
fprintf(stderr, " -E: disable encryption from client to server\n"); |
Lines 443-448
Link Here
|
443 |
|
457 |
|
444 |
g_num_devices = 0; |
458 |
g_num_devices = 0; |
445 |
|
459 |
|
|
|
460 |
slave_cmdline = NULL; |
461 |
|
446 |
#ifdef RDP2VNC |
462 |
#ifdef RDP2VNC |
447 |
#define VNCOPT "V:Q:" |
463 |
#define VNCOPT "V:Q:" |
448 |
#else |
464 |
#else |
Lines 450-456
Link Here
|
450 |
#endif |
466 |
#endif |
451 |
|
467 |
|
452 |
while ((c = getopt(argc, argv, |
468 |
while ((c = getopt(argc, argv, |
453 |
VNCOPT "Au:L:d:s:c:p:n:k:g:fbBeEmzCDKS:T:NX:a:x:Pr:045h?")) != -1) |
469 |
VNCOPT "Au:L:d:s:c:p:n:k:g:fbBeEmzCDKS:T:NX:a:x:Pr:045M:l:h?")) != -1) |
454 |
{ |
470 |
{ |
455 |
switch (c) |
471 |
switch (c) |
456 |
{ |
472 |
{ |
Lines 783-788
Link Here
|
783 |
g_use_rdp5 = True; |
799 |
g_use_rdp5 = True; |
784 |
break; |
800 |
break; |
785 |
|
801 |
|
|
|
802 |
case 'M': |
803 |
master_socket = xmalloc(sizeof(char) * (strlen(optarg) + 1)); |
804 |
STRNCPY(master_socket, optarg, sizeof(char) * (strlen(optarg) + 1)); |
805 |
break; |
806 |
|
807 |
case 'l': |
808 |
slave_cmdline = xmalloc(sizeof(char) * (strlen(optarg) + 1)); |
809 |
STRNCPY(slave_cmdline, optarg, sizeof(char) * (strlen(optarg) + 1)); |
810 |
break; |
811 |
|
786 |
case 'h': |
812 |
case 'h': |
787 |
case '?': |
813 |
case '?': |
788 |
default: |
814 |
default: |
Lines 800-805
Link Here
|
800 |
STRNCPY(server, argv[optind], sizeof(server)); |
826 |
STRNCPY(server, argv[optind], sizeof(server)); |
801 |
parse_server_and_port(server); |
827 |
parse_server_and_port(server); |
802 |
|
828 |
|
|
|
829 |
/* If slave mode is being used, the 'server' variable contains the name |
830 |
* of the control socket to use. */ |
831 |
if (slave_cmdline != NULL) |
832 |
{ |
833 |
seamless_socket_send(server, slave_cmdline); |
834 |
xfree(slave_cmdline); |
835 |
return 0; |
836 |
} |
837 |
|
803 |
if (g_seamless_rdp) |
838 |
if (g_seamless_rdp) |
804 |
{ |
839 |
{ |
805 |
if (g_win_button_size) |
840 |
if (g_win_button_size) |
Lines 837-842
Link Here
|
837 |
g_grab_keyboard = False; |
872 |
g_grab_keyboard = False; |
838 |
} |
873 |
} |
839 |
|
874 |
|
|
|
875 |
/* If we're in master mode, create a socket and listen on it. */ |
876 |
if (master_socket != NULL) |
877 |
seamless_create_socket(master_socket); |
878 |
|
840 |
if (!username_option) |
879 |
if (!username_option) |
841 |
{ |
880 |
{ |
842 |
pw = getpwuid(getuid()); |
881 |
pw = getpwuid(getuid()); |
Lines 980-985
Link Here
|
980 |
|
1019 |
|
981 |
cache_save_state(); |
1020 |
cache_save_state(); |
982 |
ui_deinit(); |
1021 |
ui_deinit(); |
|
|
1022 |
/* If we opened a socket, clean it up. */ |
1023 |
if (master_socket != NULL) |
1024 |
{ |
1025 |
seamless_close_socket(master_socket); |
1026 |
xfree(master_socket); |
1027 |
} |
983 |
|
1028 |
|
984 |
if (ext_disc_reason >= 2) |
1029 |
if (ext_disc_reason >= 2) |
985 |
print_disconnect_reason(ext_disc_reason); |
1030 |
print_disconnect_reason(ext_disc_reason); |
Lines 1624-1626
Link Here
|
1624 |
return False; |
1669 |
return False; |
1625 |
return True; |
1670 |
return True; |
1626 |
} |
1671 |
} |
|
|
1672 |
|
1673 |
// Send message to rdesktop running in SeamlessrRDP master mode |
1674 |
void |
1675 |
send_seamless_slave_message(char *cmdline) |
1676 |
{ |
1677 |
fprintf(stderr, cmdline); |
1678 |
} |