[client] core: fix dynamic res switch race issue

This commit is contained in:
Geoffrey McRae 2025-03-28 23:18:17 +11:00
parent cb423730e4
commit 868504d22d

View File

@ -190,19 +190,27 @@ bool core_warpPointer(int x, int y, bool exiting)
void core_updatePositionInfo(void)
{
if (g_state.kvmfrFeatures & KVMFR_FEATURE_WINDOWSIZE)
if (g_state.pointerQueue &&
g_state.kvmfrFeatures & KVMFR_FEATURE_WINDOWSIZE)
{
const KVMFRWindowSize msg = {
.msg.type = KVMFR_MESSAGE_WINDOWSIZE,
.w = g_state.windowW,
.h = g_state.windowH
};
static unsigned lastW = 0, lastH = 0;
if (lastW != g_state.windowW || lastH != g_state.windowH)
{
lastW = g_state.windowW;
lastH = g_state.windowH;
uint32_t serial;
LGMP_STATUS status;
if ((status = lgmpClientSendData(g_state.pointerQueue,
&msg, sizeof(msg), &serial)) != LGMP_OK)
DEBUG_WARN("Message send failed: %s", lgmpStatusString(status));
const KVMFRWindowSize msg = {
.msg.type = KVMFR_MESSAGE_WINDOWSIZE,
.w = g_state.windowW,
.h = g_state.windowH
};
uint32_t serial;
LGMP_STATUS status;
if ((status = lgmpClientSendData(g_state.pointerQueue,
&msg, sizeof(msg), &serial)) != LGMP_OK)
DEBUG_WARN("Message send failed: %s", lgmpStatusString(status));
}
}
if (!g_state.haveSrcSize)