Skip to content
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 format names not as expected on macOS #11632

Closed
xecrets opened this issue Jun 2, 2023 · 5 comments · Fixed by #13197
Closed

Clipboard format names not as expected on macOS #11632

xecrets opened this issue Jun 2, 2023 · 5 comments · Fixed by #13197
Labels

Comments

@xecrets
Copy link

xecrets commented Jun 2, 2023

Clipboard format name is not as expected. On Windows, it's "Text" as defined in DataFormats.Text, but on the Mac I'm getting "public.utf8-plain-text" and "NSStringPboardType". I shouldn't need to have platform-specific code for this, right? Similar for files copied in Finder. On Windows, getting the expected DataFormats.Files ("Files"), but on the Mac it's "public.file-url" (and a zillion other formats as well...).

Steps to reproduce the behavior:

IClipboard clipboard = (Application.Current!.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)!.MainWindow!.Clipboard!;
string[] formats = await clipboard.GetFormatsAsync();

I expect the native clipboard formats where appropriate to be mapped to the platform independent names as defined in the DataFormats static class.

  • OS: macOS 12.6.6 Monterey
  • Version 11.0.0-rc1.1

It works as expected on Windows. Have not had the time to check Linux yet.

@xecrets xecrets added the bug label Jun 2, 2023
@kekekeks
Copy link
Member

kekekeks commented Jun 2, 2023

Probably need a virtual (non-platform-specific) format list too.

@maxkatz6

@xecrets
Copy link
Author

xecrets commented Jun 9, 2023

Similar issue on Ubuntu Linux as well. Text seems to work as expected here, but copying files does not work. Using DataFormats.Files does not work, the clipboard is populated, with among other formats x-special/gnome-copied-files and text/uri-list but not the expected DataFormats.Files .

@maxkatz6
Copy link
Member

maxkatz6 commented Jun 9, 2023

@kekekeks our DataFormats already works as a virtual list on some platforms.
Like, on Browser, when you request Text or Files, browser backend will match it to the platform format and return an expected value.
Seems like it wasn't properly implemented for Linux and macOS from the beginning.

@maxkatz6 maxkatz6 added the help-wanted A contribution from the community would be most welcome. label Jun 9, 2023
@maxkatz6 maxkatz6 removed the help-wanted A contribution from the community would be most welcome. label Oct 11, 2023
@xecrets
Copy link
Author

xecrets commented Oct 12, 2023

Awesome! But... Should I open a new issue for the Linux side of things?

@timunie
Copy link
Contributor

timunie commented Oct 13, 2023

if there is no open issue for Linux, yes in my opinion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants