Skip to content

Commit 8f7c9e9

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/system_tray_rust.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ 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);
158+
}
155159
#else
156160
lifetime::exit_sunshine(0, true);
157161
#endif

0 commit comments

Comments
 (0)