Backends: ensure that ImGuiPlatformMonitor list is available after backend Init call. (#7995)

This commit is contained in:
ocornut
2024-09-19 14:25:01 +02:00
parent ae8688974b
commit 42272505c9
5 changed files with 12 additions and 4 deletions

View File

@@ -509,13 +509,15 @@ static bool ImGui_ImplSDL3_Init(SDL_Window* window, SDL_Renderer* renderer, void
#else
bd->MouseCanReportHoveredViewport = false;
#endif
bd->WantUpdateMonitors = true;
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
platform_io.Platform_SetClipboardTextFn = ImGui_ImplSDL3_SetClipboardText;
platform_io.Platform_GetClipboardTextFn = ImGui_ImplSDL3_GetClipboardText;
platform_io.Platform_SetImeDataFn = ImGui_ImplSDL3_PlatformSetImeData;
// Update monitor a first time during init
ImGui_ImplSDL3_UpdateMonitors();
// Gamepad handling
bd->GamepadMode = ImGui_ImplSDL3_GamepadMode_AutoFirst;
bd->WantUpdateGamepadsList = true;