Skip to content

Commit

Permalink
[io/win] Ensure console window is not created when running in windows…
Browse files Browse the repository at this point in the history
… mode.

Fixes #39945

TEST=ci, manually check flutter windows app doesn't pop-up console.

Change-Id: I05983947de10058e4b0d2f9cbe795bd52f97ad05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237400
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
  • Loading branch information
aam authored and Commit Bot committed Mar 15, 2022
1 parent 37e67cc commit b6c5e52
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions runtime/bin/process_win.cc
Expand Up @@ -553,6 +553,13 @@ class ProcessStarter {
EXTENDED_STARTUPINFO_PRESENT | CREATE_UNICODE_ENVIRONMENT;
if (!Process::ModeIsAttached(mode_)) {
creation_flags |= DETACHED_PROCESS;
} else {
// Ensure that if console needs to be created, it is created hidden.
// Normally stdout for console dart application is associated with console
// that is launched from, but for gui applications(flutter on windows)
// console might be absent, will be created by CreateProcessW below.
// When that happens we ensure that console window doesn't pop up.
creation_flags |= CREATE_NO_WINDOW;
}
BOOL result = CreateProcessW(
NULL, // ApplicationName
Expand Down

0 comments on commit b6c5e52

Please sign in to comment.