1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

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