diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-06 22:36:19 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-06 22:36:19 +0200 |
commit | 9ce6c7dadf47737063058adba50e7085faa9fe4a (patch) | |
tree | ced6f72edc880ec74c0e8d0406234a68c1a810dd | |
parent | c970cc687615f904e66004b6795636fbabb843cb (diff) | |
download | EpisodeBrowser-9ce6c7dadf47737063058adba50e7085faa9fe4a.tar.gz |
Update cached system metrics on DPI change.
-rw-r--r-- | c/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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<SM_CXVSCROLL> = GetSystemMetrics(SM_CXVSCROLL); + Metric<SM_CXDOUBLECLK> = GetSystemMetrics(SM_CXDOUBLECLK); + Metric<SM_CYDOUBLECLK> = 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, |