Backends: Win32, SDL, GLFW: only honor io.WantSetMousePos when focused + fix GLFW uninstalling handler + tweaks to reduce branch drift with docking. (#787, #2445, #2696, #3751, #4377)

# Conflicts:
#	backends/imgui_impl_glfw.cpp
#	backends/imgui_impl_sdl.cpp
#	backends/imgui_impl_win32.cpp
This commit is contained in:
ocornut
2021-08-02 15:48:20 +02:00
parent f9b5168fb3
commit 80b5fb51ed
3 changed files with 11 additions and 12 deletions

View File

@ -72,7 +72,6 @@ static void ImGui_ImplWin32_InitPlatformInterface();
static void ImGui_ImplWin32_ShutdownPlatformInterface();
static void ImGui_ImplWin32_UpdateMonitors();
// Win32
struct ImGui_ImplWin32_Data
{
HWND hWnd;
@ -259,7 +258,7 @@ static void ImGui_ImplWin32_UpdateMousePos()
// Set OS mouse position from Dear ImGui if requested (rarely used, only when ImGuiConfigFlags_NavEnableSetMousePos is enabled by user)
// (When multi-viewports are enabled, all Dear ImGui positions are same as OS positions)
if (io.WantSetMousePos && mouse_window != NULL)
if (io.WantSetMousePos)
{
POINT pos = { (int)mouse_pos_prev.x, (int)mouse_pos_prev.y };
if ((io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) == 0)