From 61c529eece4d588a57d35cd4901ee0fc43cd3939 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sun, 4 Jan 2026 18:12:37 +0100 Subject: [PATCH 1/5] BUILD(cmake): Also detect object libraries --- cmake/project-utils.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/project-utils.cmake b/cmake/project-utils.cmake index 213ec388e9d..3b55418bcb4 100644 --- a/cmake/project-utils.cmake +++ b/cmake/project-utils.cmake @@ -66,7 +66,7 @@ function(get_targets DEFINED_TARGETS DIR) get_target_property(TARGET_TYPE "${CURRENT_TARGET}" TYPE) # Only add the target if it is compilable - if("${TARGET_TYPE}" MATCHES "STATIC_LIBRARY|MODULE_LIBRARY|SHARED_LIBRARY|EXECUTABLE") + if("${TARGET_TYPE}" MATCHES "STATIC_LIBRARY|MODULE_LIBRARY|SHARED_LIBRARY|OBJECT_LIBRARY|EXECUTABLE") list(APPEND DEFINED_TARGETS ${CURRENT_TARGET}) endif() endforeach() From b54745cc802f8e6161cf44a4d047dc8794c3dae2 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sun, 4 Jan 2026 18:13:23 +0100 Subject: [PATCH 2/5] MAINT: Add os-events submodule --- .gitmodules | 3 +++ 3rdparty/os-events | 1 + 2 files changed, 4 insertions(+) create mode 160000 3rdparty/os-events diff --git a/.gitmodules b/.gitmodules index b92bdb23fed..2f5cfc82660 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,3 +37,6 @@ [submodule "3rdparty/CLI11"] path = 3rdparty/CLI11 url = https://github.com/CLIUtils/CLI11.git +[submodule "3rdparty/os-events"] + path = 3rdparty/os-events + url = https://github.com/mumble-voip/os-events.git diff --git a/3rdparty/os-events b/3rdparty/os-events new file mode 160000 index 00000000000..5d5025f6556 --- /dev/null +++ b/3rdparty/os-events @@ -0,0 +1 @@ +Subproject commit 5d5025f6556c510094008659b9d180ff9af99891 From 9e6ae9a1f6cc4d48b4abc37bbcf4831e55da2a4f Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sun, 4 Jan 2026 18:14:39 +0100 Subject: [PATCH 3/5] FEAT(client): Disable shortcuts while session is locked This is to ensure that nobody is able to mess with a running Mumble instance without having to unlock the OS first. --- src/mumble/CMakeLists.txt | 5 +++++ src/mumble/GlobalShortcut.cpp | 25 +++++++++++++++++++++++++ src/mumble/GlobalShortcut.h | 9 +++++++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/mumble/CMakeLists.txt b/src/mumble/CMakeLists.txt index d1e33078222..075b98c0e62 100644 --- a/src/mumble/CMakeLists.txt +++ b/src/mumble/CMakeLists.txt @@ -736,6 +736,11 @@ elseif(TARGET Opus::opus) target_link_libraries(mumble_client_object_lib PUBLIC Opus::opus) endif() +set(OSEVENTS_EXPORT OFF) +add_subdirectory("${3RDPARTY_DIR}/os-events" "${CMAKE_BINARY_DIR}/os-events" EXCLUDE_FROM_ALL) +disable_warnings_for_all_targets_in("${3RDPARTY_DIR}/os-events") +target_link_libraries(mumble_client_object_lib PRIVATE osevents::osevents) + if(bundled-speex) add_subdirectory("${3RDPARTY_DIR}/speexdsp-build" "${CMAKE_CURRENT_BINARY_DIR}/speexdsp" EXCLUDE_FROM_ALL) diff --git a/src/mumble/GlobalShortcut.cpp b/src/mumble/GlobalShortcut.cpp index 073c59f6d57..6524a6834a2 100644 --- a/src/mumble/GlobalShortcut.cpp +++ b/src/mumble/GlobalShortcut.cpp @@ -28,8 +28,14 @@ # include #endif +#include + +#include #include #include +#include + +std::atomic< bool > GlobalShortcutEngine::allowShortcutProcessing = true; const QString GlobalShortcutConfig::name = QLatin1String("GlobalShortcutConfig"); @@ -904,6 +910,21 @@ void GlobalShortcutConfig::accept() const { GlobalShortcutEngine::GlobalShortcutEngine(QObject *p) : QThread(p) { bNeedRemap = true; needRemap(); + + try { + // This is to ensure that shortcuts won't work while the OS session is locked + static std::unique_ptr< osevents::SessionLock > sessionLockWatch; + if (!sessionLockWatch) { + sessionLockWatch = std::make_unique< osevents::SessionLock >(); + sessionLockWatch->register_callback([](osevents::SessionLockState state) { + allowShortcutProcessing = state == osevents::SessionLockState::Unlocked; + }); + } + } catch (std::runtime_error &e) { + qWarning() << "Failed to register session lock state observer -> disabling shortcuts to be on the safe side (" + << e.what() << ")"; + allowShortcutProcessing = false; + } } GlobalShortcutEngine::~GlobalShortcutEngine() { @@ -987,6 +1008,10 @@ void GlobalShortcutEngine::needRemap() { * @return True if button is suppressed, otherwise false */ bool GlobalShortcutEngine::handleButton(const QVariant &button, bool down) { + if (!allowShortcutProcessing) { + return false; + } + bool already = qlDownButtons.contains(button); if (already == down) return qlSuppressed.contains(button); diff --git a/src/mumble/GlobalShortcut.h b/src/mumble/GlobalShortcut.h index 9c887c620d8..df113bc9f90 100644 --- a/src/mumble/GlobalShortcut.h +++ b/src/mumble/GlobalShortcut.h @@ -16,6 +16,8 @@ #include "MUComboBox.h" #include "Timer.h" +#include + #include "ui_GlobalShortcut.h" #include "ui_GlobalShortcutTarget.h" @@ -232,9 +234,7 @@ struct ShortcutKey { * @see GlobalShortcutWin */ class GlobalShortcutEngine : public QThread { -private: Q_OBJECT - Q_DISABLE_COPY(GlobalShortcutEngine) public: struct ButtonInfo { QString device; @@ -260,6 +260,8 @@ class GlobalShortcutEngine : public QThread { GlobalShortcutEngine(QObject *p = nullptr); ~GlobalShortcutEngine() Q_DECL_OVERRIDE; + Q_DISABLE_COPY(GlobalShortcutEngine) + void resetMap(); void remap(); virtual void needRemap(); @@ -277,6 +279,9 @@ class GlobalShortcutEngine : public QThread { virtual ButtonInfo buttonInfo(const QVariant &) = 0; signals: void buttonPressed(bool last); + +private: + static std::atomic< bool > allowShortcutProcessing; }; #endif From 58a523217b93d63a1a3f531b25d3ff4ec8fc7fd4 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sun, 4 Jan 2026 18:20:55 +0100 Subject: [PATCH 4/5] CI(linux): Install libsystemd-dev dependency in order to be able to build sdbus-c++ --- .../install-dependencies/install_ubuntu_shared_x86_64.sh | 3 ++- .../install-dependencies/install_ubuntu_static_x86_64.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-dependencies/install_ubuntu_shared_x86_64.sh b/.github/actions/install-dependencies/install_ubuntu_shared_x86_64.sh index e047d3f11e3..33b9cff5e9a 100755 --- a/.github/actions/install-dependencies/install_ubuntu_shared_x86_64.sh +++ b/.github/actions/install-dependencies/install_ubuntu_shared_x86_64.sh @@ -35,7 +35,8 @@ sudo apt -y install \ zsync \ appstream \ libpoco-dev \ - libsqlite3-dev + libsqlite3-dev \ + libsystemd-dev # The package was initially called libqt6svg6-dev. # Choose correct name based on the Ubuntu version along with some other version-specific setup diff --git a/.github/actions/install-dependencies/install_ubuntu_static_x86_64.sh b/.github/actions/install-dependencies/install_ubuntu_static_x86_64.sh index 560db26028b..10e9237c9b9 100755 --- a/.github/actions/install-dependencies/install_ubuntu_static_x86_64.sh +++ b/.github/actions/install-dependencies/install_ubuntu_static_x86_64.sh @@ -17,7 +17,8 @@ sudo apt -y install \ libsm-dev \ libspeechd-dev \ libavahi-compat-libdnssd-dev \ - libasound2-dev + libasound2-dev \ + libsystemd-dev verify_required_env_variables_set From 3a0dd242969f1db42e49daea879b1a023c8b255c Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sun, 19 Apr 2026 16:18:34 +0200 Subject: [PATCH 5/5] CI(freebsd): Install basu dependency in order to be able to build sdbus-c++ --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 01d17e89344..41bef0258c5 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,7 +8,7 @@ freebsd_instance: freebsd_task: pkg_script: - pkg update && pkg upgrade -y - - pkg install -y git ninja pkgconf cmake qt6-base qt6-svg qt6-tools boost-libs libsndfile protobuf avahi-libdns poco opus + - pkg install -y git ninja pkgconf cmake qt6-base qt6-svg qt6-tools boost-libs libsndfile protobuf avahi-libdns poco opus basu fetch_submodules_script: git submodule --quiet update --init --recursive build_script: - mkdir build && cd build