From 9ce6c7dadf47737063058adba50e7085faa9fe4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 6 Aug 2022 22:36:19 +0200 Subject: Update cached system metrics on DPI change. --- c/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/c/main.cpp b/c/main.cpp index 2f668c0..2de5df7 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -262,6 +262,14 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, /* Update DPI and cached metrics. */ g_dpi = HIWORD(wParam); Metric = GetSystemMetrics(SM_CXVSCROLL); + Metric = GetSystemMetrics(SM_CXDOUBLECLK); + Metric = GetSystemMetrics(SM_CYDOUBLECLK); + + /* TODO: What does GetSystemMetrics return depending + * on the DPI? The documentation says it is not + * DPI-aware. Does that mean that Dpi( + * GetSystemMetrics(...)) will give the correct value? + * If so, the cached values need not be updated. */ Prefer(SetWindowPos(hWnd, nullptr, r->left, r->top, -- cgit v1.2.3