Merge pull request #5428 from miniak/update-app-manifest
Update app manifest
This commit is contained in:
commit
e46a50512d
2 changed files with 7 additions and 46 deletions
|
@ -51,46 +51,6 @@ bool IsRunAsNode() {
|
||||||
return IsEnvSet(kRunAsNode) || IsEnvSet(kOldRunAsNode);
|
return IsEnvSet(kRunAsNode) || IsEnvSet(kOldRunAsNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
// Win8.1 supports monitor-specific DPI scaling.
|
|
||||||
bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) {
|
|
||||||
typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS);
|
|
||||||
SetProcessDpiAwarenessPtr set_process_dpi_awareness_func =
|
|
||||||
reinterpret_cast<SetProcessDpiAwarenessPtr>(
|
|
||||||
GetProcAddress(GetModuleHandleA("user32.dll"),
|
|
||||||
"SetProcessDpiAwarenessInternal"));
|
|
||||||
if (set_process_dpi_awareness_func) {
|
|
||||||
HRESULT hr = set_process_dpi_awareness_func(value);
|
|
||||||
if (SUCCEEDED(hr)) {
|
|
||||||
VLOG(1) << "SetProcessDpiAwareness succeeded.";
|
|
||||||
return true;
|
|
||||||
} else if (hr == E_ACCESSDENIED) {
|
|
||||||
LOG(ERROR) << "Access denied error from SetProcessDpiAwareness. "
|
|
||||||
"Function called twice, or manifest was used.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function works for Windows Vista through Win8. Win8.1 must use
|
|
||||||
// SetProcessDpiAwareness[Wrapper].
|
|
||||||
BOOL SetProcessDPIAwareWrapper() {
|
|
||||||
typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID);
|
|
||||||
SetProcessDPIAwarePtr set_process_dpi_aware_func =
|
|
||||||
reinterpret_cast<SetProcessDPIAwarePtr>(
|
|
||||||
GetProcAddress(GetModuleHandleA("user32.dll"),
|
|
||||||
"SetProcessDPIAware"));
|
|
||||||
return set_process_dpi_aware_func &&
|
|
||||||
set_process_dpi_aware_func();
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnableHighDPISupport() {
|
|
||||||
if (!SetProcessDpiAwarenessWrapper(PROCESS_SYSTEM_DPI_AWARE)) {
|
|
||||||
SetProcessDPIAwareWrapper();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
@ -154,12 +114,6 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
||||||
content::InitializeSandboxInfo(&sandbox_info);
|
content::InitializeSandboxInfo(&sandbox_info);
|
||||||
atom::AtomMainDelegate delegate;
|
atom::AtomMainDelegate delegate;
|
||||||
|
|
||||||
// We don't want to set DPI awareness on pre-Win7 because we don't support
|
|
||||||
// DirectWrite there. GDI fonts are kerned very badly, so better to leave
|
|
||||||
// DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite().
|
|
||||||
if (base::win::GetVersion() >= base::win::VERSION_WIN7)
|
|
||||||
EnableHighDPISupport();
|
|
||||||
|
|
||||||
content::ContentMainParams params(&delegate);
|
content::ContentMainParams params(&delegate);
|
||||||
params.instance = instance;
|
params.instance = instance;
|
||||||
params.sandbox_info = &sandbox_info;
|
params.sandbox_info = &sandbox_info;
|
||||||
|
|
|
@ -30,4 +30,11 @@
|
||||||
</security>
|
</security>
|
||||||
</trustInfo>
|
</trustInfo>
|
||||||
|
|
||||||
|
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||||
|
<dpiAware>true</dpiAware>
|
||||||
|
<disableWindowFiltering xmlns="http://schemas.microsoft.com/SMI/2011/WindowsSettings">true</disableWindowFiltering>
|
||||||
|
</asmv3:windowsSettings>
|
||||||
|
</asmv3:application>
|
||||||
|
|
||||||
</assembly>
|
</assembly>
|
||||||
|
|
Loading…
Reference in a new issue