Made absolute mouse coordinates work under Windows as well

This commit is contained in:
Cacodemon345
2023-01-03 21:43:10 +06:00
parent b9f8e09db0
commit ef18a27bc9
2 changed files with 5 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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;