From ae5879a20edb1aaa0db7c971833f1180df7aadae Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 15 Apr 2012 16:55:32 -0700 Subject: [PATCH] NSM: Don't allow 'added' clients to replace stopped clients. --- session-manager/src/nsmd.C | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/session-manager/src/nsmd.C b/session-manager/src/nsmd.C index 68c0921..7ea7376 100644 --- a/session-manager/src/nsmd.C +++ b/session-manager/src/nsmd.C @@ -82,7 +82,8 @@ enum { COMMAND_QUIT, COMMAND_KILL, COMMAND_SAVE, - COMMAND_OPEN + COMMAND_OPEN, + COMMAND_START }; struct Client @@ -568,6 +569,7 @@ launch ( const char *executable, const char *client_id ) } } + c->pending_command( COMMAND_START ); c->pid = pid; MESSAGE( "Process has pid: %i", pid ); @@ -743,8 +745,9 @@ OSC_HANDLER( announce ) i != client.end(); ++i ) { - if ( ! strcmp( (*i)->executable_path, executable_path ) - && ! (*i)->active ) + if ( ! strcmp( (*i)->executable_path, executable_path ) && + ! (*i)->active && + (*i)->pending_command() == COMMAND_START ) { // I think we've found the slot we were looking for. MESSAGE( "Client was expected." ); -- 2.11.4.GIT