diff --git a/CMakeLists.txt b/CMakeLists.txt index 294f5b55d..85920bc10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if(MUNT_EXTERNAL) endif() project(86Box - VERSION 3.4 + VERSION 3.4.1 DESCRIPTION "Emulator of x86-based systems" HOMEPAGE_URL "https://86box.net" LANGUAGES C CXX) diff --git a/src/include_make/86box/version.h b/src/include_make/86box/version.h index 8bf418791..f1f0719dd 100644 --- a/src/include_make/86box/version.h +++ b/src/include_make/86box/version.h @@ -22,10 +22,10 @@ #define EMU_VERSION "3.4" #define EMU_VERSION_W LSTR(EMU_VERSION) -#define EMU_VERSION_EX "3.40" +#define EMU_VERSION_EX "3.41" #define EMU_VERSION_MAJ 3 #define EMU_VERSION_MIN 4 -#define EMU_VERSION_PATCH 0 +#define EMU_VERSION_PATCH 1 #define EMU_BUILD_NUM 0 @@ -40,7 +40,7 @@ #define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest" #define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL) #ifdef RELEASE_BUILD -# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v3.2/" +# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v3.4/" #else # define EMU_DOCS_URL "https://86box.readthedocs.io" #endif diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 068e0c754..1e9c3501c 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -207,12 +207,12 @@ MainWindow::MainWindow(QWidget *parent) : qt_mouse_capture(mouse_capture); if (mouse_capture) { this->grabKeyboard(); - if (ui->stackedWidget->mouse_capture) - ui->stackedWidget->mouse_capture(this->windowHandle()); + if (ui->stackedWidget->mouse_capture_func) + ui->stackedWidget->mouse_capture_func(this->windowHandle()); } else { this->releaseKeyboard(); - if (ui->stackedWidget->mouse_uncapture) - ui->stackedWidget->mouse_uncapture(); + if (ui->stackedWidget->mouse_uncapture_func) + ui->stackedWidget->mouse_uncapture_func(); } }); @@ -514,11 +514,11 @@ void MainWindow::closeEvent(QCloseEvent *event) { } qt_nvr_save(); config_save(); - if (ui->stackedWidget->mouse_exit) - ui->stackedWidget->mouse_exit(); + + if (ui->stackedWidget->mouse_exit_func) + ui->stackedWidget->mouse_exit_func(); ui->stackedWidget->switchRenderer(RendererStack::Renderer::Software); - event->accept(); } diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index 53382ec6b..4013d037f 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -44,6 +44,7 @@ extern "C" { #include <86box/video.h> } +extern "C" void macos_poll_mouse(); extern MainWindow *main_window; RendererStack::RendererStack(QWidget *parent) : QStackedWidget(parent) @@ -67,30 +68,30 @@ RendererStack::RendererStack(QWidget *parent) # ifdef WAYLAND if (!stricmp(mouse_type, "wayland")) { - this->mouse_init = wl_init; - this->mouse_poll = wl_mouse_poll; - this->mouse_capture = wl_mouse_capture; - this->mouse_uncapture = wl_mouse_uncapture; + wl_init(); + this->mouse_poll_func = wl_mouse_poll; + this->mouse_capture_func = wl_mouse_capture; + this->mouse_uncapture_func = wl_mouse_uncapture; } else # endif # ifdef EVDEV_INPUT if (!stricmp(mouse_type, "evdev")) { - this->mouse_init = evdev_init; - this->mouse_poll = evdev_mouse_poll; + evdev_init(); + this->mouse_poll_func = evdev_mouse_poll; } else # endif if (!stricmp(mouse_type, "xinput2")) { extern void xinput2_init(); extern void xinput2_poll(); extern void xinput2_exit(); - this->mouse_init = xinput2_init; - this->mouse_poll = xinput2_poll; - this->mouse_exit = xinput2_exit; + xinput2_init(); + this->mouse_poll_func = xinput2_poll; + this->mouse_exit_func = xinput2_exit; } #endif - - if (this->mouse_init) - this->mouse_init(); +#ifdef __APPLE__ + this->mouse_poll_func = macos_poll_mouse; +#endif } RendererStack::~RendererStack() @@ -98,7 +99,6 @@ RendererStack::~RendererStack() delete ui; } -extern "C" void macos_poll_mouse(); void qt_mouse_capture(int on) { @@ -121,18 +121,16 @@ qt_mouse_capture(int on) void RendererStack::mousePoll() { -#ifdef __APPLE__ - return macos_poll_mouse(); -#else /* !defined __APPLE__ */ +#ifndef __APPLE__ mouse_x = mousedata.deltax; mouse_y = mousedata.deltay; mouse_z = mousedata.deltaz; mousedata.deltax = mousedata.deltay = mousedata.deltaz = 0; - mouse_buttons = mousedata.mousebuttons; + mouse_buttons = mousedata.mousebuttons; - if (this->mouse_poll) - this->mouse_poll(); -#endif /* !defined __APPLE__ */ + if (this->mouse_poll_func) +#endif + this->mouse_poll_func(); } int ignoreNextMouseEvent = 1; diff --git a/src/qt/qt_rendererstack.hpp b/src/qt/qt_rendererstack.hpp index 8b787d2b3..45daf838d 100644 --- a/src/qt/qt_rendererstack.hpp +++ b/src/qt/qt_rendererstack.hpp @@ -65,11 +65,10 @@ public: rendererWindow->onResize(width, height); } - void (*mouse_init)() = nullptr; - void (*mouse_poll)() = nullptr; - void (*mouse_capture)(QWindow *window) = nullptr; - void (*mouse_uncapture)() = nullptr; - void (*mouse_exit)() = nullptr; + void (*mouse_poll_func)() = nullptr; + void (*mouse_capture_func)(QWindow *window) = nullptr; + void (*mouse_uncapture_func)() = nullptr; + void (*mouse_exit_func)() = nullptr; signals: void blitToRenderer(int buf_idx, int x, int y, int w, int h);