parent
682b48095a
commit
59402eb23f
2 changed files with 11 additions and 6 deletions
|
@ -5,7 +5,6 @@
|
||||||
#include "atom/app/atom_main.h"
|
#include "atom/app/atom_main.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -57,6 +56,12 @@ bool IsRunAsNode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
bool IsCygwin() {
|
||||||
|
std::string os;
|
||||||
|
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||||
|
return env->GetVar("OS", &os) && os == "cygwin";
|
||||||
|
}
|
||||||
|
|
||||||
// Win8.1 supports monitor-specific DPI scaling.
|
// Win8.1 supports monitor-specific DPI scaling.
|
||||||
bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) {
|
bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) {
|
||||||
typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS);
|
typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS);
|
||||||
|
@ -103,17 +108,13 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
|
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
|
||||||
|
|
||||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
|
||||||
|
|
||||||
// Make output work in console if we are not in cygiwn.
|
// Make output work in console if we are not in cygiwn.
|
||||||
std::string os;
|
if (!IsCygwin() && !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE")) {
|
||||||
if (env->GetVar("OS", &os) && os != "cygwin") {
|
|
||||||
AttachConsole(ATTACH_PARENT_PROCESS);
|
AttachConsole(ATTACH_PARENT_PROCESS);
|
||||||
|
|
||||||
FILE* dontcare;
|
FILE* dontcare;
|
||||||
freopen_s(&dontcare, "CON", "w", stdout);
|
freopen_s(&dontcare, "CON", "w", stdout);
|
||||||
freopen_s(&dontcare, "CON", "w", stderr);
|
freopen_s(&dontcare, "CON", "w", stderr);
|
||||||
freopen_s(&dontcare, "CON", "r", stdin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert argv to to UTF8
|
// Convert argv to to UTF8
|
||||||
|
|
|
@ -37,6 +37,10 @@ Shows Windows's crash dialog when Electron crashed.
|
||||||
|
|
||||||
This environment variable will not work if `crashReporter` is started.
|
This environment variable will not work if `crashReporter` is started.
|
||||||
|
|
||||||
|
## `ELECTRON_NO_ATTACH_CONSOLE` _Windows_
|
||||||
|
|
||||||
|
Don't attach to current console session.
|
||||||
|
|
||||||
## `ELECTRON_FORCE_WINDOW_MENU_BAR` _Linux_
|
## `ELECTRON_FORCE_WINDOW_MENU_BAR` _Linux_
|
||||||
|
|
||||||
Don't use global menu bar on Linux.
|
Don't use global menu bar on Linux.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue