diff --git a/backends/imgui_impl_glfw.cpp b/backends/imgui_impl_glfw.cpp index 5850851aa..df060bd61 100644 --- a/backends/imgui_impl_glfw.cpp +++ b/backends/imgui_impl_glfw.cpp @@ -1284,12 +1284,10 @@ static void ImGui_ImplGlfw_ShowWindow(ImGuiViewport* viewport) ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style); } - // GLFW hack: install hook for WM_NCHITTEST message handler -#if !GLFW_HAS_MOUSE_PASSTHROUGH && GLFW_HAS_WINDOW_HOVERED && defined(_WIN32) + // GLFW hack: install WndProc for mouse source event and WM_NCHITTEST message handler. ::SetPropA(hwnd, "IMGUI_VIEWPORT", viewport); vd->PrevWndProc = (WNDPROC)::GetWindowLongPtrW(hwnd, GWLP_WNDPROC); ::SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)ImGui_ImplGlfw_WndProc); -#endif #if !GLFW_HAS_FOCUS_ON_SHOW // GLFW hack: GLFW 3.2 has a bug where glfwShowWindow() also activates/focus the window. diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 0f15b3f26..bb9fbcccf 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -469,6 +469,9 @@ Docking+Viewports Branch: - Backends: SDL3: macOS: Fixed secondary-viewports not appearing on a different monitor than the main viewport. Because SDL_SetWindowParent() seems to restrict it. - Backends: GLFW: Disable multi-viewports under Wayland (require GLFW 3.4). (#8587) +- Backends: GLFW: Fixed an issue where Win32 specific WndProc hook was not installed + for all GLFW version, preventing mouse vs touch detection from working on + secondary viewports. -----------------------------------------------------------------------