Skip to content

Commit

Permalink
Fix mono#14255: correct type and bitness for TARGETS request of X11 c…
Browse files Browse the repository at this point in the history
…lipboard
  • Loading branch information
ForNeVeR authored and sancheolz committed Dec 27, 2019
1 parent 1f3f4ac commit b40bca9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Expand Up @@ -1808,27 +1808,27 @@ static Hwnd.Borders FrameExtents (IntPtr window)

// Seems that some apps support asking for supported types
if (format_atom == TARGETS) {
int[] atoms;
IntPtr[] atoms;
int atom_count;

atoms = new int[5];
atoms = new IntPtr[5];
atom_count = 0;

if (Clipboard.IsSourceText) {
atoms[atom_count++] = (int)Atom.XA_STRING;
atoms[atom_count++] = (int)OEMTEXT;
atoms[atom_count++] = (int)UTF8_STRING;
atoms[atom_count++] = (int)UTF16_STRING;
atoms[atom_count++] = (int)RICHTEXTFORMAT;
atoms[atom_count++] = (IntPtr)Atom.XA_STRING;
atoms[atom_count++] = (IntPtr)OEMTEXT;
atoms[atom_count++] = (IntPtr)UTF8_STRING;
atoms[atom_count++] = (IntPtr)UTF16_STRING;
atoms[atom_count++] = (IntPtr)RICHTEXTFORMAT;
} else if (Clipboard.IsSourceImage) {
atoms[atom_count++] = (int)Atom.XA_PIXMAP;
atoms[atom_count++] = (int)Atom.XA_BITMAP;
atoms[atom_count++] = (IntPtr)Atom.XA_PIXMAP;
atoms[atom_count++] = (IntPtr)Atom.XA_BITMAP;
} else {
// FIXME - handle other types
}

XChangeProperty(DisplayHandle, xevent.SelectionRequestEvent.requestor, (IntPtr)xevent.SelectionRequestEvent.property,
(IntPtr)xevent.SelectionRequestEvent.target, 32, PropertyMode.Replace, atoms, atom_count);
(IntPtr)Atom.XA_ATOM, 32, PropertyMode.Replace, atoms, atom_count);
sel_event.SelectionEvent.property = xevent.SelectionRequestEvent.property;
} else if (format_atom == (IntPtr)RICHTEXTFORMAT) {
string rtf_text = Clipboard.GetRtfText ();
Expand Down

0 comments on commit b40bca9

Please sign in to comment.