From 46f86eb6bbea9516c5aba9cf9b2576ccd7f08828 Mon Sep 17 00:00:00 2001 From: Jacob van't Hoog Date: Tue, 26 Jul 2022 12:16:28 -0700 Subject: [PATCH] Fix issue with closing settings dialog from taskbar --- src/SettingsDialog.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index 42a9b0f..aefe58c 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -252,14 +252,14 @@ void openSettingsDialog() { } bool handleSettingsDialogMessage(MSG *msg) { - if (settingsDialog && PropSheet_IsDialogMessage(settingsDialog, msg)) { - if (!PropSheet_GetCurrentPageHwnd(settingsDialog)) { - DestroyWindow(settingsDialog); - settingsDialog = nullptr; - } - return true; + if (!settingsDialog) + return false; + bool isDialogMessage = !!PropSheet_IsDialogMessage(settingsDialog, msg); + if (!PropSheet_GetCurrentPageHwnd(settingsDialog)) { + DestroyWindow(settingsDialog); + settingsDialog = nullptr; } - return false; + return isDialogMessage; } } // namespace