-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Clipboard does not work in Flutter Windows #54226
Comments
I take it the text you are copying and pasting in that screenshot is not ASCII? Looking at the code and the docs, we're using |
Whatever I copied, when i paste it to Flutter TextField, it will always be a single garbled character. |
I have the same problem on Window, please help to fix it! |
Fixes several bugs in the clipboard code, and makes some structural improvements: - Adds scoped wrappers for clipboard open/close and global lock/unlock, to prevent missing cleanup, fixing at least one case where the lock was not released. - Adds the relevant window handle to the clipboard calls, since the docs suggest that some operations won't work without one. - Adds a missing clear step to setting the clipboard data. - Switches from TEXT to UNICODETEXT to handle non-ASCII text correctly. - To enable that, adds UTF-16/-8 conversion utilities built on the Win32 APIs (rather than the deprecated std::codecvt functions, as have been previously used in the engine). - Fixes handling of getting data when the clipboard is empty, correctly returning null. - Passes more errors back through the method channel, with details, for easier debugging of future issues. Fixes flutter/flutter#54226
Fixes several bugs in the clipboard code, and makes some structural improvements: - Adds scoped wrappers for clipboard open/close and global lock/unlock, to prevent missing cleanup, fixing at least one case where the lock was not released. - Adds the relevant window handle to the clipboard calls, since the docs suggest that some operations won't work without one. - Adds a missing clear step to setting the clipboard data. - Switches from TEXT to UNICODETEXT to handle non-ASCII text correctly. - To enable that, adds UTF-16/-8 conversion utilities built on the Win32 APIs (rather than the deprecated std::codecvt functions, as have been previously used in the engine). - Fixes handling of getting data when the clipboard is empty, correctly returning null. - Passes more errors back through the method channel, with details, for easier debugging of future issues. Fixes flutter/flutter#54226
Fixes several bugs in the clipboard code, and makes some structural improvements: - Adds scoped wrappers for clipboard open/close and global lock/unlock, to prevent missing cleanup, fixing at least one case where the lock was not released. - Adds the relevant window handle to the clipboard calls, since the docs suggest that some operations won't work without one. - Adds a missing clear step to setting the clipboard data. - Switches from TEXT to UNICODETEXT to handle non-ASCII text correctly. - To enable that, adds UTF-16/-8 conversion utilities built on the Win32 APIs (rather than the deprecated std::codecvt functions, as have been previously used in the engine). - Fixes handling of getting data when the clipboard is empty, correctly returning null. - Passes more errors back through the method channel, with details, for easier debugging of future issues. Fixes flutter/flutter#54226
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
Clipboard.setData(ClipboardData(text: "abc"));
Paste in notepad or somewhere else.
Or:
Copy something form notepad or somewhere else.
Paste it in Flutter TextField
Expected results:
Paste/Copy
Actual results:
Flutter's clipboard works individually with Windows system. It cannot copy something to Windows clipboard. And when trying copy some from Windows to Flutter TextField, only garbled pasted.
Logs
The text was updated successfully, but these errors were encountered: