From 5810f39f4d502a1040b35a8c7f132d5aec04a8ff Mon Sep 17 00:00:00 2001 From: richardg867 Date: Wed, 20 Apr 2022 20:55:26 -0300 Subject: [PATCH] Selectable mouse type on Linux, part 3 --- src/qt/qt_mainwindow.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 09676ee34..6a55d6f6a 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -207,18 +207,12 @@ MainWindow::MainWindow(QWidget *parent) : qt_mouse_capture(mouse_capture); if (mouse_capture) { this->grabKeyboard(); -#ifdef WAYLAND - if (QGuiApplication::platformName().contains("wayland")) { - wl_mouse_capture(this->windowHandle()); - } -#endif + if (ui->stackedWidget->mouse_capture) + ui->stackedWidget->mouse_capture(this->windowHandle()); } else { this->releaseKeyboard(); -#ifdef WAYLAND - if (QGuiApplication::platformName().contains("wayland")) { - wl_mouse_uncapture(); - } -#endif + if (ui->stackedWidget->mouse_uncapture) + ui->stackedWidget->mouse_uncapture(); } });