[feat] support minimizing to the system tray on Linux when closing

This commit is contained in:
dijunkun
2026-06-23 17:05:14 +08:00
parent e026491b9f
commit d8e9fa5bba
9 changed files with 1171 additions and 23 deletions
+5 -1
View File
@@ -128,7 +128,11 @@ bool Daemon::start(MainLoopFunc loop) {
if (pid > 0) _exit(0);
umask(0);
chdir("/");
if (chdir("/") != 0) {
std::cerr << "Failed to change daemon working directory to /: "
<< std::strerror(errno) << std::endl;
return false;
}
// redirect file descriptors: keep stdout/stderr if from terminal, else
// redirect to /dev/null