From a9226f81d9151016208cc961cfe87808beb19df9 Mon Sep 17 00:00:00 2001 From: Warchamp7 Date: Wed, 13 Aug 2025 10:47:20 -0700 Subject: [PATCH] frontend: Fix UI deadlock There is a Qt bug introduced around Qt 6.8.3 that causes the application to hang when double clicking the sources list and the Windows setting 'Snap mouse to default button in dialog boxes' is enabled. Work around this by using a timer if the setting is enabled. --- frontend/components/SourceTreeItem.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend/components/SourceTreeItem.cpp b/frontend/components/SourceTreeItem.cpp index c063b3d4d..775348a5d 100644 --- a/frontend/components/SourceTreeItem.cpp +++ b/frontend/components/SourceTreeItem.cpp @@ -11,6 +11,11 @@ #include "plugin-manager/PluginManager.hpp" +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif + #include "moc_SourceTreeItem.cpp" static inline OBSScene GetCurrentScene() @@ -280,7 +285,22 @@ void SourceTreeItem::mouseDoubleClickEvent(QMouseEvent *event) obs_source_t *source = obs_sceneitem_get_source(sceneitem); OBSBasic *main = OBSBasic::Get(); if (obs_source_configurable(source)) { +#if defined(_WIN32) + /* This timer works around a bug introduced around Qt 6.8.3 that causes + * the application to hang when double clicking the sources list and the + * Windows setting 'Snap mouse to default button in dialog boxes' is enabled. + */ + bool snapEnabled; + SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &snapEnabled, 0); + + if (snapEnabled) { + QTimer::singleShot(200, this, [=]() { main->CreatePropertiesWindow(source); }); + } else { + main->CreatePropertiesWindow(source); + } +#else main->CreatePropertiesWindow(source); +#endif } } }