From ef18a27bc92137156b2a82335ef72c121e01d00e Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Tue, 3 Jan 2023 21:43:10 +0600 Subject: [PATCH] Made absolute mouse coordinates work under Windows as well --- src/qt/qt_main.cpp | 1 - src/qt/qt_rendererstack.cpp | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 1ae545227..b162e6abc 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -246,7 +246,6 @@ main(int argc, char *argv[]) auto rawInputFilter = WindowsRawInputFilter::Register(main_window); if (rawInputFilter) { app.installNativeEventFilter(rawInputFilter.get()); - QObject::disconnect(main_window, &MainWindow::pollMouse, 0, 0); QObject::connect(main_window, &MainWindow::pollMouse, (WindowsRawInputFilter *) rawInputFilter.get(), &WindowsRawInputFilter::mousePoll, Qt::DirectConnection); main_window->setSendKeyboardInput(false); } diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index 0436112d1..bf9098592 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -144,6 +144,11 @@ qt_mouse_capture(int on) void RendererStack::mousePoll() { +#ifdef Q_OS_WINDOWS + mouse_x_abs = mousedata.x_abs; + mouse_y_abs = mousedata.y_abs; + return; +#endif #ifndef __APPLE__ mouse_x = mousedata.deltax; mouse_y = mousedata.deltay;