Quaver icon indicating copy to clipboard operation
Quaver copied to clipboard

[Wayland] Copying text appends null byte

Open Emik03 opened this issue 8 months ago • 1 comments

Describe the bug

Copying notes, copying text from ImGui editor plugins, or using imgui.SetClipboardText causes an unexpected null byte to be copied alongside the text. This causes dialogs that restrict character inputs to be unable to paste text copied within Quaver.

To Reproduce

  1. Launch the game on a machine that runs Wayland on Linux.
  2. Open the editor.
  3. Copy any hit object.
  4. Attempt to paste it in the "Go To Objects" dialog. This will fail due to the appended null byte.

Expected behavior

There is no null byte appended to the end of the string in all three scenarios. This extra character can also trip up plugins, as there is now a discrepancy between different operating systems:

local function isWayland()
    imgui.SetClipboardText("test")
    return imgui.GetClipboardText() ~= "test"
end

Log Files

N/A

Screenshots

2024-06-27 01-35-18 remuxed

Emik03 avatar Jun 26 '24 23:06 Emik03