From 3a707a5ee5444c08522ba1a4de694d9937536153 Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Sun, 8 Feb 2026 13:31:13 -0500 Subject: [PATCH] Merge pull request #1988 from gamesguru/fix/settings-comboBox-no-autocapture-scroll prevent comboBox & spinner from capturing mouse scroll unless active --- .gitlab-ci.yml | 4 ++-- CMakeLists.txt | 8 ++++++-- resources/qml/dialogs/RoomSettingsDialog.qml | 7 +++++-- resources/qml/pages/UserSettingsPage.qml | 12 +++++++----- third_party/olm-patches/0002-fix-cmake-cmp0148.patch | 11 +++++++++++ 5 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 third_party/olm-patches/0002-fix-cmake-cmp0148.patch diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f85cfba..724ee5d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -450,8 +450,8 @@ linting: before_script: - apk update && apk add make git python3 py3-pip qt6-qtdeclarative-dev # clang18 seems to mess with the emit keyword when using the `->` operator - - apk add clang17-extra-tools --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main - - export PATH="$PATH:/usr/lib/llvm17/bin/:/root/.local/bin" + - apk add clang-extra-tools --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main + - export PATH="$PATH:/usr/lib/llvm/bin/:/root/.local/bin" - pip3 install --break-system-packages --user reuse script: - make lint diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fdae58f..eeb0cba1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,6 +246,7 @@ endif() # # Discover Qt dependencies. # + find_package(Qt6 6.5 COMPONENTS Core Widgets Gui LinguistTools Svg Multimedia Qml QuickControls2 REQUIRED) if (Qt6Qml_VERSION VERSION_GREATER_EQUAL "6.10.0") find_package(Qt6 REQUIRED COMPONENTS GuiPrivate QmlPrivate) @@ -298,7 +299,8 @@ if(NOT MSVC) -fsized-deallocation \ -fdiagnostics-color=always \ -Wunreachable-code \ - -Wno-attributes" + -Wno-attributes \ + -Wno-error=unused-parameter" ) if(NOT CMAKE_COMPILER_IS_GNUCXX) # -Wshadow is buggy and broken in GCC, so do not enable it. @@ -542,7 +544,9 @@ if(USE_BUNDLED_OLM) Olm GIT_REPOSITORY https://gitlab.matrix.org/matrix-org/olm.git GIT_TAG 3.2.16 - PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/third_party/olm-patches/0001-fix-list-const-ptr.patch + PATCH_COMMAND git apply + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/olm-patches/0001-fix-list-const-ptr.patch + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/olm-patches/0002-fix-cmake-cmp0148.patch UPDATE_DISCONNECTED 1 ) set(OLM_TESTS OFF CACHE INTERNAL "") diff --git a/resources/qml/dialogs/RoomSettingsDialog.qml b/resources/qml/dialogs/RoomSettingsDialog.qml index 696cd9c9..ab24bbf2 100644 --- a/resources/qml/dialogs/RoomSettingsDialog.qml +++ b/resources/qml/dialogs/RoomSettingsDialog.qml @@ -304,13 +304,16 @@ ApplicationWindow { } ComboBox { + id: notificationsCombo + Layout.fillWidth: true model: [qsTr("Muted"), qsTr("Mentions only"), qsTr("All messages")] currentIndex: roomSettings.notifications onActivated: (index) => { roomSettings.changeNotifications(index); } - Layout.fillWidth: true - WheelHandler{} // suppress scrolling changing values + + // Disable built-in wheel handling unless focused + wheelEnabled: activeFocus } Label { diff --git a/resources/qml/pages/UserSettingsPage.qml b/resources/qml/pages/UserSettingsPage.qml index 1ce32725..8f51e668 100644 --- a/resources/qml/pages/UserSettingsPage.qml +++ b/resources/qml/pages/UserSettingsPage.qml @@ -100,10 +100,13 @@ Rectangle { model: r.model.values currentIndex: r.model.value width: Math.min(implicitWidth, scroll.availableWidth - Nheko.paddingMedium) - onActivated: r.model.value = currentIndex + onActivated: { + r.model.value = currentIndex + } implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted - WheelHandler{} // suppress scrolling changing values + // Disable built-in wheel handling unless focused + wheelEnabled: activeFocus } } DelegateChoice { @@ -118,7 +121,7 @@ Rectangle { onValueChanged: model.value = value editable: true - WheelHandler{} // suppress scrolling changing values + wheelEnabled: activeFocus } } DelegateChoice { @@ -153,7 +156,7 @@ Rectangle { return Number.fromLocaleString(locale, text) * spinbox.div } - WheelHandler{} // suppress scrolling changing values + wheelEnabled: activeFocus } } DelegateChoice { @@ -272,6 +275,5 @@ Rectangle { ToolTip.text: qsTr("Back") onClicked: mainWindow.pop() } - } diff --git a/third_party/olm-patches/0002-fix-cmake-cmp0148.patch b/third_party/olm-patches/0002-fix-cmake-cmp0148.patch new file mode 100644 index 00000000..37518b99 --- /dev/null +++ b/third_party/olm-patches/0002-fix-cmake-cmp0148.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2026-01-25 20:50:49.905592647 -0500 ++++ CMakeLists.txt 2026-01-25 20:50:49.908925942 -0500 +@@ -1,4 +1,7 @@ +-cmake_minimum_required(VERSION 3.4) ++cmake_minimum_required(VERSION 3.5) ++if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.27") ++ cmake_policy(SET CMP0148 OLD) ++endif() + + project(olm VERSION 3.2.16 LANGUAGES CXX C) +