From ea594406627b55a7c848326257767e4feb366f38 Mon Sep 17 00:00:00 2001 From: David Maas Date: Fri, 21 Feb 2025 17:08:16 +0100 Subject: [PATCH] Backends: Win32: WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh of monitor list. (#8415) --- backends/imgui_impl_win32.cpp | 5 +++++ docs/CHANGELOG.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/backends/imgui_impl_win32.cpp b/backends/imgui_impl_win32.cpp index d9e206066..ab4dce3cd 100644 --- a/backends/imgui_impl_win32.cpp +++ b/backends/imgui_impl_win32.cpp @@ -23,6 +23,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) // 2025-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface. +// 2025-02-21: [Docking] WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh of monitor list. (#8415) // 2024-11-21: [Docking] Fixed a crash when multiple processes are running with multi-viewports, caused by misusage of GetProp(). (#8162, #8069) // 2024-10-28: [Docking] Rely on property stored inside HWND to retrieve context/viewport, should facilitate attempt to use this for parallel contexts. (#8069) // 2024-09-16: [Docking] Inputs: fixed an issue where a viewport destroyed while clicking would hog mouse tracking and temporary lead to incorrect update of HoveredWindow. (#7971) @@ -865,6 +866,10 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandlerEx(HWND hwnd, UINT msg, WPA case WM_DISPLAYCHANGE: bd->WantUpdateMonitors = true; return 0; + case WM_SETTINGCHANGE: + if (wParam == SPI_SETWORKAREA) + bd->WantUpdateMonitors = true; + return 0; } return 0; } diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 9a0eea0d6..71a36a6bb 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -99,6 +99,8 @@ Docking+Viewports Branch: - Viewports: fixed an assert when a window load settings with a position outside monitor bounds, when there are multiple monitors. (#8393, #8385) [@gaborodriguez] +- Backends: Win32: WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh + of monitor list, as they contain work area information. (#8415) [@PathogenDavid, @lailoken] -----------------------------------------------------------------------