Skip to content

Commit 3bfa5fa

Browse files
committed
fix: 修复托盘退出
1 parent 96a3769 commit 3bfa5fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/system_tray_rust.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ namespace system_tray {
151151
BOOST_LOG(info) << "Quitting from system tray"sv;
152152
#ifdef _WIN32
153153
terminate_gui_processes();
154-
lifetime::exit_sunshine(ERROR_SHUTDOWN_IN_PROGRESS, true);
154+
if (GetConsoleWindow() == NULL) {
155+
lifetime::exit_sunshine(ERROR_SHUTDOWN_IN_PROGRESS, true);
156+
} else {
157+
lifetime::exit_sunshine(0, true);
155158
#else
156159
lifetime::exit_sunshine(0, true);
157160
#endif

0 commit comments

Comments
 (0)