Backends: GLFW: passing null window to glfwGetClipboardString()/glfwSetClipboardString().

This commit is contained in:
ocornut 2024-08-22 18:13:34 +02:00
parent bf75504d7a
commit 8e40104795
2 changed files with 6 additions and 5 deletions

View File

@ -176,14 +176,14 @@ static ImGui_ImplGlfw_Data* ImGui_ImplGlfw_GetBackendData()
}
// Functions
static const char* ImGui_ImplGlfw_GetClipboardText(void* user_data)
static const char* ImGui_ImplGlfw_GetClipboardText(void*)
{
return glfwGetClipboardString((GLFWwindow*)user_data);
return glfwGetClipboardString(NULL);
}
static void ImGui_ImplGlfw_SetClipboardText(void* user_data, const char* text)
static void ImGui_ImplGlfw_SetClipboardText(void*, const char* text)
{
glfwSetClipboardString((GLFWwindow*)user_data, text);
glfwSetClipboardString(NULL, text);
}
static ImGuiKey ImGui_ImplGlfw_KeyToImGuiKey(int key)
@ -588,7 +588,6 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
io.ClipboardUserData = bd->Window;
#ifdef __EMSCRIPTEN__
io.PlatformOpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplGlfw_EmscriptenOpenURL(url); return true; };
#endif

View File

@ -62,6 +62,8 @@ Other changes:
provide a way to do a portable sleep. (#7844)
- Backends: SDL2, SDL3: ignore events of other SDL windows. (#7853) [@madebr, @ocornut]
- Backends: SDL2, SDL3: storing SDL_WindowID inside ImGuiViewport::PlatformHandle instead of SDL_Window*.
- Backends: GLFW: passing null window to glfwGetClipboardString()/glfwSetClipboardString()
since GLFW own tests are doing that and it seems unnecessary.
- Examples: GLFW (all), SDL2 (all), SDL3 (all), Win32+OpenGL3: rework examples main loop
to handle minimization without burning CPU or GPU by running unthrottled code. (#7844)