Document the new seamless protocol command PERSISTENT

and implement the usage of the new command in rdesktop.

If a seamless command is specified the persistent mode
of the session will be changed to non-persistent.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1822 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Henrik Andersson 2014-07-03 10:42:04 +00:00
parent 2ceb56e0d4
commit 46a3684c27
5 changed files with 35 additions and 1 deletions

View File

@ -294,6 +294,22 @@ For each window, the server will send CREATE, POSITION and STATE, in that
order, just as if the window was created. Note that a TITLE may also, order, just as if the window was created. Note that a TITLE may also,
optionally, be sent before the STATE. optionally, be sent before the STATE.
PERSISTENT
----------
Change persistent mode for the session.
Syntax:
PERSISTENT,<SERIAL>,<ENABLE>
A seamless session always starts in persistent mode. This means that
the session will not terminate if all applications is closed.
Upon re-connection to a session, the session will reset to persistent
mode and client needs to change this if non persistent mode is wanted.
If a persistent session not have any application running and is in
disconnected state, it will terminate after a timeout is reached that
matches the lifetime of the re-connection cookie.
POSITION POSITION
-------- --------

View File

@ -346,6 +346,7 @@ unsigned int seamless_send_zchange(unsigned long id, unsigned long below, unsign
unsigned int seamless_send_focus(unsigned long id, unsigned long flags); unsigned int seamless_send_focus(unsigned long id, unsigned long flags);
unsigned int seamless_send_destroy(unsigned long id); unsigned int seamless_send_destroy(unsigned long id);
unsigned int seamless_send_spawn(char *cmd); unsigned int seamless_send_spawn(char *cmd);
unsigned int seamless_send_persistent(RD_BOOL);
/* scard.c */ /* scard.c */
void scard_lock(int lock); void scard_lock(int lock);

View File

@ -109,6 +109,7 @@ RD_BOOL g_seamless_rdp = False;
RD_BOOL g_use_password_as_pin = False; RD_BOOL g_use_password_as_pin = False;
char g_seamless_shell[512]; char g_seamless_shell[512];
char g_seamless_spawn_cmd[512]; char g_seamless_spawn_cmd[512];
RD_BOOL g_seamless_persistent_mode = True;
RD_BOOL g_user_quit = False; RD_BOOL g_user_quit = False;
uint32 g_embed_wnd; uint32 g_embed_wnd;
uint32 g_rdp5_performanceflags = uint32 g_rdp5_performanceflags =
@ -614,6 +615,7 @@ main(int argc, char *argv[])
case 's': case 's':
STRNCPY(shell, optarg, sizeof(shell)); STRNCPY(shell, optarg, sizeof(shell));
g_seamless_persistent_mode = False;
break; break;
case 'c': case 'c':

View File

@ -3,7 +3,7 @@
Seamless Windows support Seamless Windows support
Copyright 2005-2008 Peter Astrand <astrand@cendio.se> for Cendio AB Copyright 2005-2008 Peter Astrand <astrand@cendio.se> for Cendio AB
Copyright 2007-2008 Pierre Ossman <ossman@cendio.se> for Cendio AB Copyright 2007-2008 Pierre Ossman <ossman@cendio.se> for Cendio AB
Copyright 2013 Henrik Andersson <hean01@cendio.se> for Cendio AB Copyright 2013-2014 Henrik Andersson <hean01@cendio.se> for Cendio AB
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -542,3 +542,15 @@ seamless_send_spawn(char *cmdline)
return res; return res;
} }
unsigned int
seamless_send_persistent(RD_BOOL enable)
{
unsigned int res;
if (!g_seamless_rdp)
return (unsigned int) -1;
printf("%s persitent seamless mode.\n", enable?"Enable":"Disable");
res = seamless_send("PERSISTENT", "%d", enable);
return res;
}

3
xwin.c
View File

@ -95,6 +95,7 @@ static RD_BOOL g_seamless_active = False; /* We are currently in seamless mode *
static RD_BOOL g_seamless_hidden = False; /* Desktop is hidden on server */ static RD_BOOL g_seamless_hidden = False; /* Desktop is hidden on server */
static RD_BOOL g_seamless_broken_restack = False; /* WM does not properly restack */ static RD_BOOL g_seamless_broken_restack = False; /* WM does not properly restack */
extern RD_BOOL g_seamless_rdp; extern RD_BOOL g_seamless_rdp;
extern RD_BOOL g_seamless_persistent_mode;
extern uint32 g_embed_wnd; extern uint32 g_embed_wnd;
RD_BOOL g_enable_compose = False; RD_BOOL g_enable_compose = False;
@ -3827,6 +3828,8 @@ ui_seamless_begin(RD_BOOL hidden)
seamless_send_spawn(g_seamless_spawn_cmd); seamless_send_spawn(g_seamless_spawn_cmd);
g_seamless_spawn_cmd[0] = 0; g_seamless_spawn_cmd[0] = 0;
} }
seamless_send_persistent(g_seamless_persistent_mode);
} }