From 273f5e2bfe99e6ac2baccdf455d24940eac11ab6 Mon Sep 17 00:00:00 2001 From: Murnux Date: Sat, 24 Feb 2018 20:53:51 -0800 Subject: [PATCH] UI: Don't close windows for "Always on Top" (win32) On windows, the "Always on top" state can safely be used without closing dialogs. Closes obsproject/obs-studio#1207 --- UI/window-basic-main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index abed8b134..490a42b15 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5077,12 +5077,14 @@ void OBSBasic::on_previewDisabledLabel_customContextMenuRequested( void OBSBasic::on_actionAlwaysOnTop_triggered() { - CloseDialogs(); - +#ifndef _WIN32 /* Make sure all dialogs are safely and successfully closed before * switching the always on top mode due to the fact that windows all * have to be recreated, so queue the actual toggle to happen after * all events related to closing the dialogs have finished */ + CloseDialogs(); +#endif + QMetaObject::invokeMethod(this, "ToggleAlwaysOnTop", Qt::QueuedConnection); }