From e87eb25c648f6cc4731fc1a6ba3f72df24abd826 Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Sat, 25 May 2024 19:59:34 +0200 Subject: [PATCH] re-enable mouse-lock on SAPP_EVENTTYPE_FOCUSED (see https://github.com/floooh/sokol/issues/1056) --- src/doomgeneric_sokol.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doomgeneric_sokol.c b/src/doomgeneric_sokol.c index c3d209e71..65aa54332 100644 --- a/src/doomgeneric_sokol.c +++ b/src/doomgeneric_sokol.c @@ -549,6 +549,10 @@ static int AccelerateMouse(int val) { } void input(const sapp_event* ev) { + if (ev->type == SAPP_EVENTTYPE_FOCUSED) { + sapp_lock_mouse(false); + sapp_lock_mouse(true); + } if (app.state == APP_STATE_WAITING) { if ((ev->type == SAPP_EVENTTYPE_KEY_DOWN) || (ev->type == SAPP_EVENTTYPE_MOUSE_DOWN) ||