From a2f84be2d4f81f49b12b28f5a0f8479f5499a05b Mon Sep 17 00:00:00 2001 From: DanS Date: Sun, 30 Aug 2026 23:43:12 -0500 Subject: [PATCH] fix(win): stop console-window flash on launch (spawn daemon with CREATE_NO_WINDOW) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The embedded daemon was launched with CREATE_NEW_CONSOLE + SW_HIDE. CREATE_NEW_CONSOLE allocates a console window that flashes on screen before SW_HIDE hides it — visible as a console-window flash every time the wallet starts dragonxd (i.e. on launch). Switch to CREATE_NO_WINDOW (the console child gets no window at all, matching the xmrig launcher); dragonxd logs to debug.log, not a console, so nothing is lost. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/daemon/embedded_daemon.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/daemon/embedded_daemon.cpp b/src/daemon/embedded_daemon.cpp index e4487eb..e922cbd 100644 --- a/src/daemon/embedded_daemon.cpp +++ b/src/daemon/embedded_daemon.cpp @@ -689,7 +689,10 @@ bool EmbeddedDaemon::startProcess(const std::string& binary_path, const std::vec debug_log_path_.c_str(), debug_log_offset_); } - // Launch daemon with CREATE_NEW_CONSOLE (hidden via SW_HIDE). + // Launch daemon windowless. Use CREATE_NO_WINDOW (NOT CREATE_NEW_CONSOLE): CREATE_NEW_CONSOLE + // allocates a console window that briefly flashes on screen before SW_HIDE can hide it, which is + // visible as a console-window flash on wallet launch. CREATE_NO_WINDOW gives the console child no + // window at all (same approach as the xmrig launcher). The daemon logs to debug.log, not a console. // The daemon binary must NOT be in the data directory (%APPDATA%\Hush\DRAGONX) // — it must be in /dragonx/ to avoid conflicts with lock files and data. STARTUPINFOA si; @@ -699,7 +702,7 @@ bool EmbeddedDaemon::startProcess(const std::string& binary_path, const std::vec si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; ZeroMemory(&pi, sizeof(pi)); - + char* cmd_line = _strdup(cmd.c_str()); BOOL success = CreateProcessA( NULL, @@ -707,7 +710,7 @@ bool EmbeddedDaemon::startProcess(const std::string& binary_path, const std::vec NULL, NULL, FALSE, - CREATE_NEW_CONSOLE, + CREATE_NO_WINDOW, NULL, work_dir.c_str(), &si,