From fd28d0604eb85a056c0da38b4d5a3d7a42abcfa9 Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Sun, 6 Feb 2022 22:19:27 -0500 Subject: [PATCH] [host/client] kvmfr: request activation based on guest state --- client/src/main.c | 3 +++ common/include/common/KVMFR.h | 1 + host/src/app.c | 1 + 3 files changed, 5 insertions(+) diff --git a/client/src/main.c b/client/src/main.c index 80d7c3de..f6969bdd 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -758,6 +758,9 @@ int main_frameThread(void * unused) break; } + if (frame->requestActivation) + g_state.ds->requestActivation(); + if (g_params.autoScreensaver && g_state.autoIdleInhibitState != frame->blockScreensaver) { if (frame->blockScreensaver) diff --git a/common/include/common/KVMFR.h b/common/include/common/KVMFR.h index 4a2a2e65..6d8847ae 100644 --- a/common/include/common/KVMFR.h +++ b/common/include/common/KVMFR.h @@ -139,6 +139,7 @@ typedef struct KVMFRFrame uint32_t damageRectsCount; // the number of damage rectangles (zero for full-frame damage) FrameDamageRect damageRects[KVMFR_MAX_DAMAGE_RECTS]; bool blockScreensaver; // whether the guest has requested to block screensavers + bool requestActivation; // whether the guest has requested activation since the last frame } KVMFRFrame; diff --git a/host/src/app.c b/host/src/app.c index 263e44c6..2f8fc02d 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -276,6 +276,7 @@ static bool sendFrame(void) fi->pitch = frame.pitch; fi->offset = app.pageSize - FrameBufferStructSize; fi->blockScreensaver = os_blockScreensaver(); + fi->requestActivation = true; // TODO app.frameValid = true; fi->damageRectsCount = frame.damageRectsCount;