You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a following program, compile it and run with Mono:
using System.Windows.Forms;namespaceConsoleApplication1{internalclassProgram{publicstaticvoidMain(string[]args){varform=new Form();vartextBox=new TextBox();
form.Controls.Add(textBox);
Application.Run(form);}}}
Enter any text into a text box, select it and press Ctrl-C (or other default keyboard shortcut for Copy action).
Current Behavior
Try to paste the result:
into gedit: success
into gnome-terminal: failure
into any Swing-based Java application: failure
Try to call xclip -selection clipboard -o -t TARGETS > targets.txt: it will output 40 bytes of garbage instead of a list of newline-separated targets supported by Mono.
Expected Behavior
Paste into gnome-terminal and into any Swing-based Java application should work by default.
xclip -selection clipboard -o -t TARGETS should output a list of newline-separated targets, not garbage.
On which platforms did you notice this
Linux (I was testing on a 64-bit Ubuntu 18.04)
Version Used:
Latest master, commit 90a91429ae75240b4d0e791a563a9d553be09d56, and latest stable, version 5.20.1.19.
Analysis
The information provided by Mono into X11 clipboard mechanism is wrong in two ways:
Mono claims to provide the information of type TARGETS instead of type ATOM, so XGetWindowProperty will fail if asked to get information of type ATOM when performing a paste action.
The corresponding Mono code seems to think that X11 Atom is 32-bit always, but it is not the case: Atom is 64-bit on a 64-bit system.
I will send a patch fixing the issues soon.
The text was updated successfully, but these errors were encountered:
ForNeVeR
changed the title
Copying from Mono port of Windows Forms doesn't work in some programs
Copying from Mono port of Windows Forms doesn't work in some programs on Linux
Apr 28, 2019
Fixmono#14255: correct type and bitness for TARGETS request of X11 clipboard
(cherry picked from commit c9c50f8)
Change-Id: Id1531ea265635ba5a618291160eca3d36585937e
Steps to Reproduce
Current Behavior
Try to paste the result:
gedit
: successgnome-terminal
: failureTry to call
xclip -selection clipboard -o -t TARGETS > targets.txt
: it will output 40 bytes of garbage instead of a list of newline-separated targets supported by Mono.Expected Behavior
gnome-terminal
and into any Swing-based Java application should work by default.xclip -selection clipboard -o -t TARGETS
should output a list of newline-separated targets, not garbage.On which platforms did you notice this
Version Used:
Latest
master
, commit90a91429ae75240b4d0e791a563a9d553be09d56
, and latest stable, version 5.20.1.19.Analysis
The information provided by Mono into X11 clipboard mechanism is wrong in two ways:
TARGETS
instead of typeATOM
, soXGetWindowProperty
will fail if asked to get information of typeATOM
when performing a paste action.Atom
is 32-bit always, but it is not the case:Atom
is 64-bit on a 64-bit system.I will send a patch fixing the issues soon.
The text was updated successfully, but these errors were encountered: