[UI] Windows: Disable rounded corners

This commit is contained in:
Triang3l 2022-05-05 21:46:20 +03:00
parent 9c8e0cc53e
commit 5875f6ab31
5 changed files with 15 additions and 5 deletions

View file

@ -13,7 +13,7 @@ drivers.
* For Visual Studio 2022, MSBuild `v142` must be used due to a compiler bug; See [#2003](https://github.com/xenia-project/xenia/issues/2003).
* [Python 3.6+](https://www.python.org/downloads/)
* Ensure Python is in PATH.
* Windows 10 SDK version 10.0.19041.0 (for Visual Studio 2019, this or any newer version)
* Windows 11 SDK version 10.0.22000.0 (for Visual Studio 2019, this or any newer version)
```
git clone https://github.com/xenia-project/xenia.git

View file

@ -225,8 +225,9 @@ workspace("xenia")
platforms({"Windows"})
-- 10.0.15063.0: ID3D12GraphicsCommandList1::SetSamplePositions.
-- 10.0.19041.0: D3D12_HEAP_FLAG_CREATE_NOT_ZEROED.
-- 10.0.22000.0: DWMWA_WINDOW_CORNER_PREFERENCE.
filter("action:vs2017")
systemversion("10.0.19041.0")
systemversion("10.0.22000.0")
filter("action:vs2019")
systemversion("10.0")
filter({})

View file

@ -21,5 +21,6 @@ project("xenia-ui")
filter("platforms:Windows")
links({
"DXGI",
"dwmapi",
"dxgi",
})

View file

@ -23,8 +23,8 @@
#include "xenia/ui/virtual_key.h"
#include "xenia/ui/windowed_app_context_win.h"
// For per-monitor DPI awareness v1.
#include <ShellScalingApi.h>
#include <dwmapi.h>
namespace xe {
namespace ui {
@ -182,6 +182,14 @@ bool Win32Window::OpenImpl() {
}
}
// Disable rounded corners starting with Windows 11 (or silently receive and
// ignore E_INVALIDARG on Windows versions before 10.0.22000.0), primarily to
// preserve all pixels of the guest output.
DWM_WINDOW_CORNER_PREFERENCE window_corner_preference = DWMWCP_DONOTROUND;
DwmSetWindowAttribute(hwnd_, DWMWA_WINDOW_CORNER_PREFERENCE,
&window_corner_preference,
sizeof(window_corner_preference));
// Disable flicks.
ATOM atom = GlobalAddAtomW(L"MicrosoftTabletPenServiceProperty");
const DWORD_PTR dwHwndTabletProperty =

View file

@ -920,7 +920,7 @@ class BuildShadersCommand(Command):
print('ERROR: could not find 32-bit Program Files')
return 1
windows_sdk_bin_path = os.path.join(
program_files_path, 'Windows Kits/10/bin/10.0.19041.0/x64')
program_files_path, 'Windows Kits/10/bin/10.0.22000.0/x64')
if not os.path.exists(windows_sdk_bin_path):
print('ERROR: could not find Windows 10 SDK binaries')
return 1