diff --git a/client/main.c b/client/main.c index 427286a0..46ca6a80 100644 --- a/client/main.c +++ b/client/main.c @@ -745,15 +745,6 @@ int run() state.shmSize = ivshmem_get_map_size(); state.shm->hostID = ivshmem_get_id(); - // flag the host that we are starting up this is important so that - // the host wakes up if it is waiting on an interrupt, the host will - // also send us the current mouse shape since we won't know it yet - DEBUG_INFO("Waiting for host to signal it's ready..."); - __sync_or_and_fetch(&state.shm->flags, KVMFR_HEADER_FLAG_RESTART); - while(state.running && (state.shm->flags & KVMFR_HEADER_FLAG_RESTART)) - usleep(1000); - DEBUG_INFO("Host ready, starting session"); - if (params.useSpice) { if (!spice_connect(params.spiceHost, params.spicePort, "")) @@ -783,6 +774,15 @@ int run() break; } + // flag the host that we are starting up this is important so that + // the host wakes up if it is waiting on an interrupt, the host will + // also send us the current mouse shape since we won't know it yet + DEBUG_INFO("Waiting for host to signal it's ready..."); + __sync_or_and_fetch(&state.shm->flags, KVMFR_HEADER_FLAG_RESTART); + while(state.running && (state.shm->flags & KVMFR_HEADER_FLAG_RESTART)) + usleep(1000); + DEBUG_INFO("Host ready, starting session"); + while(state.running) renderThread(NULL);