-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrupted clipboard data (was: InputTextMultiline gibberish) #4029
Comments
I can't reproduce this issue on my machine. If you paste the text in something else like Notepad or Visual Studio does it appear corrupted there as well? Edit: Also does it still happen if you comment out the following lines in imgui/backends/imgui_impl_glfw.cpp Lines 176 to 178 in d6a5cc7
(This will cause the clipboard to be handled by Dear ImGui's implementation instead of the GLFW's. Their implementations are basically the same, but aren't quite identical.) |
@PathogenDavid thank you very much for interest and the tips
I've updated the GIF in the topic to more elaborate reproduction. In that gif I've used the original example source without changing anything (git cloned everything to a new location to make sure everything's intact). |
@LPVOIDDev No problem!
Thanks for clarifying! I tried the manual typing as in your gif as well as your code snippet. I did some investigation and I have two theories as to what might be wrong, but since I can't reproduce this issue on my machine I can't validate those theories. Could you clone this This fork adds this small test window: Click If you could copy+paste the output logged in the console window that'd be very helpful as well. |
@PathogenDavid thank you very much Looks like your theory is correct! The results for four tests are the following:
Log from cmd:
|
Excellent, thanks for testing that! I'll get a proper fix for both Dear ImGui and GWFL written and submitted sometime this weekend. If you're curious, the "cause" is this definition for the
It's really weird that it's causing an issue to use For my own curiosity: What language is your system in? Do you have any apps installed that might mess with the clipboard? (Maybe look through the startup tab in Task Manager.) Do you have clipboard sync enabled in Settings > System > Clipboard? |
@PathogenDavid Thank you very much!
Actually there was a bigger issue that led me to reveal this bug. |
…to fix clipboard corruption on some systems. This change also disables the use of GLFW and Allegro's clipboard functions on Windows since they exhibit the same issue. Fixes ocornut#4029
Thanks for the info! I've submitted a PR for Dear ImGui's implementation here: #4036
I was hoping changing my system language to Russian would let me reproduce it locally, but sadly it does not:
I'm very curious as well! Unfortunately I'm not experiencing this issue either, but I didn't dig very far. You should try pausing the app in your debugger to see where it's getting stuck. |
@PathogenDavid thank you very much!
I've found out about the issue and the way to reproduce it reliably (at least on my machine) |
Thank you both @LPVOIDDev for reporting and @PathogenDavid for the incredible investigation :) |
Hi there, Most probably @LPVOIDDev is infected with cliptomaner (see the Kaspersky report), a malware that searches the clipboard for strings that match a Bitcoin address pattern, and replaces them with a different address. 33yPjjSMGHPp8zj1ZXySNJzSUfVSbpXEuL is not gibberish but the replace (Bitcoin) address of the attacker. It's very straightforward: 111111111111111111111111111111111 matches the pattern of a Bitcoin address, that's why it is replaced within the clipboard of the O.S. (not an issue related with Dear ImGui). The same should happen with other Bitcoin addresses, give it a try. Hope it makes sense. |
@r00tw33d Thank you very much! This seems to be true! But this didn't partly. The example with 33 1's didn't work on notepad, but it really did convert real bitcoin addresses to that exact value. |
Oh wow thanks for sharing, @r00tw33d! I didn't even think to look up the garbage. I just assumed it was uninitialized memory that happened to be the same every time for whatever reason. (I actually considered asking @LPVOIDDev to reboot to see if it changed but never bothered.) So really I just found a bug in the dumb virus 🙃 |
@PathogenDavid yeah and it's insane how imgui community helped me find a virus on my machine that's been sitting there silently since September 2020! (according to task creation date) |
Closing, but I imagine we'll make sure to ample link at this issue in the future :) Should get a honorable mention in the next release note! |
Version/Branch of Dear ImGui:
Version: Dear ImGui 1.83 WIP (18203)
Branch: master
Back-end/Renderer/Compiler/OS
Original Back-ends from ImGUI Repository
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
Compiler: Visual Studio 2015 (v140)
Operating System: Windows 10
My Issue/Question:
When copying text, sometimes it gives the wrong results
It is very easy to reproduce in the demo version
Demo > Widgets > Text Input > Multi-line Text Input
Ctrl+A
,Ctrl+C
,Ctrl+V
The result will be some gibberish text.
Screenshots/Video
Standalone, minimal, complete and verifiable example:
The text was updated successfully, but these errors were encountered: