[client] app: better handling of transition to/from spice display

This commit is contained in:
Geoffrey McRae 2022-05-23 22:35:27 +10:00
parent b5dfbcb5a2
commit 47b2a26898
2 changed files with 6 additions and 5 deletions

View File

@ -1011,20 +1011,23 @@ bool app_guestIsOther(void)
void app_useSpiceDisplay(bool enable)
{
if (!g_params.useSpice)
static bool enabled = false;
if (!g_params.useSpice || enabled == enable)
return;
if (!purespice_hasChannel(PS_CHANNEL_DISPLAY))
return;
enabled = enable;
if (enable)
{
purespice_connectChannel(PS_CHANNEL_DISPLAY);
// do not call spiceShow as the surface create callback will do this
RENDERER(spiceShow, true);
}
else
{
RENDERER(spiceShow, false);
purespice_disconnectChannel(PS_CHANNEL_DISPLAY);
RENDERER(spiceShow, false);
}
}

View File

@ -885,8 +885,6 @@ static void spice_surfaceCreate(unsigned int surfaceId, PSSurfaceFormat format,
core_updatePositionInfo();
renderQueue_spiceConfigure(width, height);
if (g_state.lgr)
RENDERER(spiceShow, true);
}
static void spice_surfaceDestroy(unsigned int surfaceId)