diff --git a/src/qt/qt_hardwarerenderer.cpp b/src/qt/qt_hardwarerenderer.cpp index 30d4a42a8..5e34c1079 100644 --- a/src/qt/qt_hardwarerenderer.cpp +++ b/src/qt/qt_hardwarerenderer.cpp @@ -4,6 +4,7 @@ extern "C" { #include <86box/86box.h> +#include <86box/plat.h> } void HardwareRenderer::resizeGL(int w, int h) @@ -45,3 +46,19 @@ void HardwareRenderer::resizeEvent(QResizeEvent *event) { onResize(width(), height()); QOpenGLWindow::resizeEvent(event); } + +void HardwareRenderer::mouseReleaseEvent(QMouseEvent *event) +{ + if (this->geometry().contains(event->pos()) && event->button() == Qt::LeftButton && !mouse_capture) + { + plat_mouse_capture(1); + this->setCursor(Qt::BlankCursor); + return; + } + if (mouse_capture && event->button() == Qt::MiddleButton) + { + plat_mouse_capture(0); + this->setCursor(Qt::ArrowCursor); + return; + } +} \ No newline at end of file diff --git a/src/qt/qt_hardwarerenderer.hpp b/src/qt/qt_hardwarerenderer.hpp index 8b75d19b8..e5f1c1845 100644 --- a/src/qt/qt_hardwarerenderer.hpp +++ b/src/qt/qt_hardwarerenderer.hpp @@ -49,4 +49,5 @@ public slots: protected: void resizeEvent(QResizeEvent *event) override; + void mouseReleaseEvent(QMouseEvent* event) override; };