On macOS with wxWidgets 3.3.3, using wxTextDataObject with a wxString and putting it to the clipboard will result in a string with null filling when it is pasted in another application, like wxWidgets will result in wxWidgets. Behavior is introduced with wxWidgets 3.3.3.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Thanks for reporting this and sorry for breaking it.
I don't know if this is related to 7148a49 (see #26565) or was broken even earlier, does reverting that commit help?
cc @csomor
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
this looks like an UTF16 representation, I'll check
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@tobiolo Ok, I've rebuilt the dnd sample, used from the Menu clipboard -> copy text, which does construct a wxTextDataObject on the stack using a wxString and puts the data on the clipboard.
There both formats public.utf8-plain-text and public.utf16-plain-text are present with the correct data (the app Pasteboard Viewer is useful for monitoring data bytewise btw), also when pasting this into TextEdit, BBEdit or Word this works correctly on my macOS 15 test machine against wx 3.3.3.1.
So I'd need some more info. Does the dnd sample work for you ? if not, which application are you getting the nulls pasted - which is correct for utf16, but would be wrong when dealing with this as a plain text ...
image.png (view on web)—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Thanks for your replies. I have to precise my initial bug report. The issue occurs when wxTextDataObject is within a wxDataObjectComposite.
diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp
index 33e08d102c..5a1b5ae43c 100644
--- a/samples/dnd/dnd.cpp
+++ b/samples/dnd/dnd.cpp
@@ -1523,14 +1523,9 @@ void DnDFrame::OnCopy(wxCommandEvent& WXUNUSED(event))
return;
}
- if ( !wxTheClipboard->AddData(new wxTextDataObject(m_strText)) )
- {
- wxLogError("Can't copy data to the clipboard");
- }
- else
- {
- wxLogMessage("Text '%s' put on the clipboard", m_strText);
- }
+ auto *clipboarddata = new wxDataObjectComposite();
+ clipboarddata->Add(new wxTextDataObject(m_strText));
+ wxTheClipboard->SetData(clipboarddata);
wxTheClipboard->Close();
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
And yes, reverting 7148a49 solved the issue with wxTextDataObject in wxDataObjectComposite for me.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()