[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

@@ -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 =