Fixes Windows to macOS keyboard paste. - #1
Open
pocketlim wants to merge 1 commit into
Open
Conversation
…rContents() right before NSPasteboard.general.setString() to ensure that the contents are correctly written. According to Apple's own pasteboard documentation, copying is a two-step process: first clear the existing contents to establish your app as the new owner of the pasteboard, then write your data.
|
Oops, this is the wrong place for a PR. This codebase has long been merged with https://github.com/KDE/kdeconnect-ios (mirror of https://invent.kde.org/network/kdeconnect-ios), as mentioned in the task section of the readme, as well as evident in that repo. There is also another PR on GitLab (of which this repo is a mirror, so PRs aren't reviewed here, either): https://invent.kde.org/ruixuantu/kdeconnect-mac/-/merge_requests/4/. But even that one should be submitted to the iOS version now. |
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.
Adds
NSPasteboard.general.clearContents()right beforeNSPasteboard.general.setString()to ensure that the contents are correctly written. A corresponding debug message was added below these lines to show if the NSPasteboard was updated successfully.According to Apple's own pasteboard documentation, copying is a two-step process: first clear the existing contents to establish your app as the new owner of the pasteboard, then write your data.
How I got to this point
I just wanted to find a random utility that let me copy something from Windows and have it show up on the mac easier than my normal
Open Signal, paste something to my notes, go to mac, open Signal, copy from my notesannoyance. I used KDE Connect on the macOS and KDE Connect on Windows, but it never could pair correctly.Then I found kdeconnect-mac, and tried it out, and it paired right away! However, the "Send Clipboard" never seemed to work. I took a look at the code and figured out that it might need this line to work, and boom.... it works now!
Now I don't have to open Signal every time! Although I guess it's nice having a record of everything that was sent.
Anyway, here's a PR that fixes this issue. Thanks for coming to my TEDTalk.