Repository navigation
android: Back the platform clipboard with ClipboardManager - #22
Closed
Bombatomica64 wants to merge 1 commit into
Closed
Bombatomica64 wants to merge 1 commit into
Bombatomica64 wants to merge 1 commit into
Conversation
AndroidClipboard kept copied text in process memory only, so copy/paste did not reach other apps and paste never saw the system clipboard. With the clipboard feature enabled, read/write now go through packages::clipboard (ClipboardManager via JNI), keeping the in-memory copy as a fallback when the JNI call fails. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Author
|
Sorry for the noise. I've combined this into a single PR, #24, so there's only one to review. Closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AndroidClipboardstored copied text in process memory only. Text copied in a GPUI app (for example Kit's input or TextView "Copy") could not be pasted into other apps, and paste inside the app never saw what other apps had copied. Theclipboardpackage (packages::clipboard, backed byGpuiClipboard.javaandClipboardManager) already existed but the platform clipboard did not use it.Change
With the
clipboardfeature (on by default),AndroidClipboard::read/writego throughpackages::clipboard::{get_text, set_text}. The in-process copy is kept and used as a fallback, with alog::warn!, when the JNI call fails (for example if a host does not packageGpuiClipboard.java). Without the feature, behaviour is unchanged.Testing
cargo fmt --all,cargo check,cargo ndk -t arm64-v8a checkwith and without--features clipboard, andcargo test --lib(46 passed).cargo testdoc tests:platform_viewandplatform_view_elementfail identically onmain, so that failure is not from this change.aarch64-apple-ioswas not checked (Linux machine); the change is Android-only code.Related Kit report: longbridge/gpui-kit#3310
🤖 Generated with Claude Code