From 553b04883ee3e329ab7ce81a4ebbdb2360e92f21 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 13 Jan 2022 18:52:19 +0100 Subject: [PATCH] Backends: SDL: Fix for Emscriptem. Amend 98ce013. --- backends/imgui_impl_sdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/imgui_impl_sdl.cpp b/backends/imgui_impl_sdl.cpp index f0109547..8feef9c2 100644 --- a/backends/imgui_impl_sdl.cpp +++ b/backends/imgui_impl_sdl.cpp @@ -424,7 +424,7 @@ static void ImGui_ImplSDL2_UpdateMouseData() { int window_x, window_y, mouse_x_global, mouse_y_global; SDL_GetGlobalMouseState(&mouse_x_global, &mouse_y_global); - SDL_GetWindowPosition(focused_window, &window_x, &window_y); + SDL_GetWindowPosition(bd->Window, &window_x, &window_y); io.MousePos = ImVec2((float)(mouse_x_global - window_x), (float)(mouse_y_global - window_y)); } }