From 646a725c0ec8e6ce2e5cac0a8f8e41dc83c4da76 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 18 Sep 2022 23:12:42 -0400 Subject: [PATCH] [client] spice: wait 1 second before attempting to use spice video This prevents the flash of spice display when it's not set to mirror in the VM. --- client/src/main.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index 58575866..fb8d8cac 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1016,11 +1016,6 @@ int spiceThread(void * arg) #endif }; - /* use the spice display until we get frames from the LG host application - * it is safe to call this before connect as it will be delayed until - * spiceReady is called */ - app_useSpiceDisplay(true); - if (!purespice_connect(&config)) { DEBUG_ERROR("Failed to connect to spice server"); @@ -1425,12 +1420,24 @@ restart: msgsCount = 0; memset(msgs, 0, sizeof(msgs)); + uint64_t initialSpiceEnable = microtime() + 1000 * 1000; + while(g_state.state == APP_STATE_RUNNING) { + if (initialSpiceEnable && microtime() > initialSpiceEnable) + { + /* use the spice display until we get frames from the LG host application + * it is safe to call this before connect as it will be delayed until + * spiceReady is called */ + app_useSpiceDisplay(true); + initialSpiceEnable = 0; + } + status = lgmpClientSessionInit(g_state.lgmp, &udataSize, (uint8_t **)&udata); switch(status) { case LGMP_OK: + initialSpiceEnable = 0; break; case LGMP_ERR_INVALID_VERSION: