From 5b1de10ffc351c38ffcaf4b55c8289393fd84232 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 22 Mar 2006 16:20:55 +0000 Subject: [PATCH] Support for the new HIDE/UNHIDE commands. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/branches/seamlessrdp-branch/rdesktop@1192 423420c4-83ab-492f-b58f-81f9feb106b5 --- constants.h | 3 +++ proto.h | 4 +++- seamless.c | 24 +++++++++++++++++++++++- xwin.c | 40 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 68 insertions(+), 3 deletions(-) diff --git a/constants.h b/constants.h index 20e54c7..7f3eed6 100644 --- a/constants.h +++ b/constants.h @@ -421,3 +421,6 @@ enum RDP_INPUT_DEVICE #define SEAMLESSRDP_POSITION_TIMER 200000 #define SEAMLESSRDP_CREATE_MODAL 0x0001 + +#define SEAMLESSRDP_HELLO_RECONNECT 0x0001 +#define SEAMLESSRDP_HELLO_HIDDEN 0x0002 diff --git a/proto.h b/proto.h index fe19d46..4d9bbb0 100644 --- a/proto.h +++ b/proto.h @@ -272,7 +272,9 @@ void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy); void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy); void ui_begin_update(void); void ui_end_update(void); -void ui_seamless_begin(void); +void ui_seamless_begin(BOOL hidden); +void ui_seamless_hide_desktop(void); +void ui_seamless_unhide_desktop(void); void ui_seamless_toggle(void); void ui_seamless_create_window(unsigned long id, unsigned long group, unsigned long parent, unsigned long flags); diff --git a/seamless.c b/seamless.c index 90ca3f4..b200e4a 100644 --- a/seamless.c +++ b/seamless.c @@ -244,7 +244,7 @@ seamless_process_line(const char *line, void *data) if (*endptr) return False; - ui_seamless_begin(); + ui_seamless_begin(!!(flags & SEAMLESSRDP_HELLO_HIDDEN)); } else if (!strcmp("ACK", tok1)) { @@ -256,6 +256,28 @@ seamless_process_line(const char *line, void *data) ui_seamless_ack(serial); } + else if (!strcmp("HIDE", tok1)) + { + if (!tok3) + return False; + + flags = strtoul(tok3, &endptr, 0); + if (*endptr) + return False; + + ui_seamless_hide_desktop(); + } + else if (!strcmp("UNHIDE", tok1)) + { + if (!tok3) + return False; + + flags = strtoul(tok3, &endptr, 0); + if (*endptr) + return False; + + ui_seamless_unhide_desktop(); + } xfree(l); diff --git a/xwin.c b/xwin.c index 2e7c9d4..8ef8647 100644 --- a/xwin.c +++ b/xwin.c @@ -82,6 +82,7 @@ static seamless_window *g_seamless_windows = NULL; static unsigned long g_seamless_focused = 0; static BOOL g_seamless_started = False; /* Server end is up and running */ static BOOL g_seamless_active = False; /* We are currently in seamless mode */ +static BOOL g_seamless_hidden = False; /* Desktop is hidden on server */ extern BOOL g_seamless_rdp; extern uint32 g_embed_wnd; @@ -3244,7 +3245,7 @@ ui_end_update(void) void -ui_seamless_begin() +ui_seamless_begin(BOOL hidden) { if (!g_seamless_rdp) return; @@ -3253,6 +3254,40 @@ ui_seamless_begin() return; g_seamless_started = True; + g_seamless_hidden = hidden; + + if (!hidden) + ui_seamless_toggle(); +} + + +void +ui_seamless_hide_desktop() +{ + if (!g_seamless_rdp) + return; + + if (!g_seamless_started) + return; + + if (g_seamless_active) + ui_seamless_toggle(); + + g_seamless_hidden = True; +} + + +void +ui_seamless_unhide_desktop() +{ + if (!g_seamless_rdp) + return; + + if (!g_seamless_started) + return; + + g_seamless_hidden = False; + ui_seamless_toggle(); } @@ -3266,6 +3301,9 @@ ui_seamless_toggle() if (!g_seamless_started) return; + if (g_seamless_hidden) + return; + if (g_seamless_active) { /* Deactivate */