Skip to content

Commit

Permalink
Backends: GLFW: undo accidentally not committing use of Platform_SetC…
Browse files Browse the repository at this point in the history
…lipboardTextFn as I was testing the legacy path (amend 214977e).
  • Loading branch information
ocornut committed Aug 22, 2024
1 parent 5de7f69 commit d15da2c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions backends/imgui_impl_glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,6 @@ static ImGui_ImplGlfw_Data* ImGui_ImplGlfw_GetBackendData()
}

// Functions
static const char* ImGui_ImplGlfw_GetClipboardText(void*)
{
return glfwGetClipboardString(NULL);
}

static void ImGui_ImplGlfw_SetClipboardText(void*, const char* text)
{
glfwSetClipboardString(NULL, text);
}

static ImGuiKey ImGui_ImplGlfw_KeyToImGuiKey(int key)
{
switch (key)
Expand Down Expand Up @@ -591,8 +581,8 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
bd->Time = 0.0;

ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
platform_io.Platform_SetClipboardTextFn = [](ImGuiContext*, const char* text) { glfwSetClipboardString(NULL, text); };
platform_io.Platform_GetClipboardTextFn = [](ImGuiContext*) { return glfwGetClipboardString(NULL); };
#ifdef __EMSCRIPTEN__
platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplGlfw_EmscriptenOpenURL(url); return true; };
#endif
Expand Down

0 comments on commit d15da2c

Please sign in to comment.