From 9b306751c47386c99b9f48579bba8d5596a5f8bb Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Tue, 8 Mar 2022 23:25:35 +0200 Subject: [PATCH] qt: fix mouse getting captured even if VM has no mouse --- src/qt/qt_ui.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qt/qt_ui.cpp b/src/qt/qt_ui.cpp index c9f5c5451..413057334 100644 --- a/src/qt/qt_ui.cpp +++ b/src/qt/qt_ui.cpp @@ -34,6 +34,7 @@ extern "C" { #include <86box/plat.h> #include <86box/ui.h> +#include <86box/mouse.h> void plat_delay_ms(uint32_t count) @@ -72,6 +73,9 @@ void plat_setfullscreen(int on) { } void plat_mouse_capture(int on) { + if (!kbd_req_capture && (mouse_type == MOUSE_TYPE_NONE)) + return; + main_window->setMouseCapture(on > 0 ? true : false); }