diff --git a/proto.h b/proto.h index 6b696a4..45f58cb 100644 --- a/proto.h +++ b/proto.h @@ -336,6 +336,7 @@ void ui_seamless_ack(unsigned int serial); RD_BOOL lspci_init(void); /* seamless.c */ RD_BOOL seamless_init(void); +void seamless_reset_state(void); unsigned int seamless_send_sync(void); unsigned int seamless_send_state(unsigned long id, unsigned int state, unsigned long flags); unsigned int seamless_send_position(unsigned long id, int x, int y, int width, int height, diff --git a/seamless.c b/seamless.c index 896f08d..4e3e603 100644 --- a/seamless.c +++ b/seamless.c @@ -32,6 +32,7 @@ extern RD_BOOL g_seamless_rdp; static VCHANNEL *seamless_channel; static unsigned int seamless_serial; +static char *seamless_rest = NULL; static char icon_buf[1024]; static char * @@ -373,7 +374,6 @@ static void seamless_process(STREAM s) { unsigned int pkglen; - static char *rest = NULL; char *buf; pkglen = s->end - s->p; @@ -385,7 +385,7 @@ seamless_process(STREAM s) hexdump(s->p, pkglen); #endif - str_handle_lines(buf, &rest, seamless_line_handler, NULL); + str_handle_lines(buf, &seamless_rest, seamless_line_handler, NULL); xfree(buf); } @@ -405,6 +405,15 @@ seamless_init(void) return (seamless_channel != NULL); } +void +seamless_reset_state(void) +{ + if (seamless_rest != NULL) + { + xfree(seamless_rest); + seamless_rest = NULL; + } +} static unsigned int seamless_send(const char *command, const char *format, ...) diff --git a/xwin.c b/xwin.c index 01c97c1..859c9dc 100644 --- a/xwin.c +++ b/xwin.c @@ -2121,6 +2121,7 @@ ui_create_window(void) if (g_seamless_rdp) { + seamless_reset_state(); seamless_restack_test(); }