|
@@ -28,7 +28,8 @@
|
|
|
|
|
|
// CHANGELOG
|
|
// CHANGELOG
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
-// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
|
|
|
|
|
|
+// 2025-03-03: Fixed clipboard handler assertion when using GLFW <= 3.2.1 compiled with asserts enabled.
|
|
|
|
+// 2024-08-22: Moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
|
|
// - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn
|
|
// - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn
|
|
// - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn
|
|
// - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn
|
|
// - io.PlatformOpenInShellFn -> platform_io.Platform_OpenInShellFn
|
|
// - io.PlatformOpenInShellFn -> platform_io.Platform_OpenInShellFn
|
|
@@ -598,8 +599,14 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
|
|
bd->Time = 0.0;
|
|
bd->Time = 0.0;
|
|
|
|
|
|
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
|
|
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
|
|
|
|
+#if GLFW_VERSION_COMBINED < 3300
|
|
|
|
+ platform_io.Platform_SetClipboardTextFn = [](ImGuiContext*, const char* text) { glfwSetClipboardString(ImGui_ImplGlfw_GetBackendData()->Window, text); };
|
|
|
|
+ platform_io.Platform_GetClipboardTextFn = [](ImGuiContext*) { return glfwGetClipboardString(ImGui_ImplGlfw_GetBackendData()->Window); };
|
|
|
|
+#else
|
|
platform_io.Platform_SetClipboardTextFn = [](ImGuiContext*, const char* text) { glfwSetClipboardString(nullptr, text); };
|
|
platform_io.Platform_SetClipboardTextFn = [](ImGuiContext*, const char* text) { glfwSetClipboardString(nullptr, text); };
|
|
platform_io.Platform_GetClipboardTextFn = [](ImGuiContext*) { return glfwGetClipboardString(nullptr); };
|
|
platform_io.Platform_GetClipboardTextFn = [](ImGuiContext*) { return glfwGetClipboardString(nullptr); };
|
|
|
|
+#endif
|
|
|
|
+
|
|
#ifdef __EMSCRIPTEN__
|
|
#ifdef __EMSCRIPTEN__
|
|
platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplGlfw_EmscriptenOpenURL(url); return true; };
|
|
platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplGlfw_EmscriptenOpenURL(url); return true; };
|
|
#endif
|
|
#endif
|