• R/O
  • HTTP
  • SSH
  • HTTPS

MUtilities: Commit

MUtilities development repository


Commit MetaInfo

Revisionb6091380a65b0d3b26e40be98f0c34c94a28e048 (tree)
Zeit2021-05-29 11:04:56
AutorLoRd_MuldeR <mulder2@gmx....>
CommiterLoRd_MuldeR

Log Message

In fatal_exit() function: Clear the TOPMOST attribute of all windows, before showing the message box.

Ändern Zusammenfassung

Diff

--- a/src/OSSupport_Win32.cpp
+++ b/src/OSSupport_Win32.cpp
@@ -2012,10 +2012,10 @@ static volatile bool g_debug_check = check_debugger_helper();
20122012 static MUtils::Internal::CriticalSection g_fatal_exit_lock;
20132013 static QAtomicInt g_fatal_exit_flag;
20142014
2015-static DWORD WINAPI fatal_exit_helper(LPVOID lpParameter)
2015+static BOOL CALLBACK fatal_exit_enum_helper(const HWND hwnd, const LPARAM lParam)
20162016 {
2017- MUtils::OS::system_message_err(L"GURU MEDITATION", (LPWSTR) lpParameter);
2018- return 0;
2017+ SetWindowPos(hwnd, HWND_NOTOPMOST, NULL, NULL, NULL, NULL, SWP_ASYNCWINDOWPOS | SWP_NOMOVE | SWP_NOSIZE);
2018+ return TRUE;
20192019 }
20202020
20212021 void MUtils::OS::fatal_exit(const wchar_t* const errorMessage)
@@ -2027,6 +2027,8 @@ void MUtils::OS::fatal_exit(const wchar_t* const errorMessage)
20272027 return; /*prevent recursive invocation*/
20282028 }
20292029
2030+ EnumThreadWindows(g_main_thread_id, fatal_exit_enum_helper, 0L);
2031+
20302032 if(g_main_thread_id != GetCurrentThreadId())
20312033 {
20322034 if(HANDLE hThreadMain = OpenThread(THREAD_SUSPEND_RESUME, FALSE, g_main_thread_id))
@@ -2035,14 +2037,7 @@ void MUtils::OS::fatal_exit(const wchar_t* const errorMessage)
20352037 }
20362038 }
20372039
2038- if(HANDLE hThread = CreateThread(NULL, 0, fatal_exit_helper, (LPVOID)errorMessage, 0, NULL))
2039- {
2040- WaitForSingleObject(hThread, INFINITE);
2041- }
2042- else
2043- {
2044- fatal_exit_helper((LPVOID)errorMessage);
2045- }
2040+ MUtils::OS::system_message_err(L"GURU MEDITATION", errorMessage);
20462041
20472042 for(;;)
20482043 {
Show on old repository browser