From 6a0bcf2d2d8d079be5fa1995d5d386818d144030 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Tue, 16 May 2023 17:30:50 +0300 Subject: [PATCH] Fix bug 62201 --- ChromiumBasedEditors/lib/helper_main.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ChromiumBasedEditors/lib/helper_main.cpp b/ChromiumBasedEditors/lib/helper_main.cpp index f6028d3c..a6f50fb5 100644 --- a/ChromiumBasedEditors/lib/helper_main.cpp +++ b/ChromiumBasedEditors/lib/helper_main.cpp @@ -36,11 +36,20 @@ int main( int argc, char *argv[] ) { #ifdef _WIN32 - Core_SetProcessDpiAwareness(); + Core_SetProcessDpiAwareness(); + + // Set non-browser processes up to be killed by the system after the + // browser goes away. The browser uses the default shutdown order, which + // is 0x280. Note that lower numbers here denote "kill later" and higher + // numbers mean "kill sooner". This gets rid of most of those unsightly + // sad tabs on logout and shutdown. + const int kNonBrowserShutdownPriority = 0x280; + ::SetProcessShutdownParameters(kNonBrowserShutdownPriority - 1, SHUTDOWN_NORETRY); + #endif - CApplicationCEF application; - CAscApplicationManager manager; + CApplicationCEF application; + CAscApplicationManager manager; - return application.Init_CEF(&manager, argc, argv); + return application.Init_CEF(&manager, argc, argv); }