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

revamp drag-n-drop and clipboard support for X11 / linux #21258

Open
wants to merge 91 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
eec1293
this patch:
ThomasKuehne Oct 24, 2021
9129a11
support string[] in addition to StringCollection in GetFileDropList
ThomasKuehne Oct 24, 2021
52fde56
added missing XGetAtomName libX11 function
ThomasKuehne Oct 27, 2021
ad93be5
Merge branch 'mono:main' into main
ThomasKuehne Oct 29, 2021
0186ee7
Fix for (#21259) X11 drag-n-drop is limited to 3 DND formats
ThomasKuehne Oct 30, 2021
65e3009
Fixes #21268 request X11 clipboard's TARGETS instead of every known f…
ThomasKuehne Oct 30, 2021
ba7a1b0
add Trace / DebugHelper version of XGetAtomName
ThomasKuehne Oct 30, 2021
566350c
explicit feedback for requested, un-supported formats
ThomasKuehne Nov 1, 2021
56f3097
Fixes #21271 dnd drop no-longer provided format
ThomasKuehne Nov 1, 2021
b9bbb5d
X11Dnd - review access modifiers
ThomasKuehne Nov 2, 2021
08ddcc6
Fixes #21276 X11 drag-n-drop unsupported request
ThomasKuehne Nov 2, 2021
aed1427
Fixes #21278 drag-n-drop clipboard race condition
ThomasKuehne Nov 2, 2021
96dd8ef
code review: dead parameters
ThomasKuehne Nov 3, 2021
fa01a19
code review: comments
ThomasKuehne Nov 3, 2021
ca88a85
code review : XGetWindowProperty error handling
ThomasKuehne Nov 3, 2021
744daf5
Merge branch 'mono:main' into main
ThomasKuehne Nov 16, 2021
97372a4
unified X11's DND and clipboard handling
ThomasKuehne Nov 21, 2021
f5f1aa2
Merge branch 'mono:main' into main
ThomasKuehne Nov 21, 2021
11ec9f3
Adds full path to libcairo for correct assembly directory resolution …
netonjm Nov 30, 2021
58acc4b
Fix dist-hook target
akoeplinger Nov 30, 2021
1003a56
Fix BinaryReader Read to Span of byte and char (#21357)
bholmes Dec 10, 2021
c84ce32
[cominterop] Add coop handle enter/return on native CCW methods (#21…
lambdageek Dec 13, 2021
e4288c4
Fixes #21372 index overflow in pedump.c:dump_blob (#21373)
ThomasKuehne Dec 22, 2021
d55b9dc
transform sgen_get_descriptor to parallel safe version in job_major_m…
tmijieux Jan 3, 2022
fd07fc2
[interp] Remove hack for nint/nfloat (#21382)
BrzVlad Jan 4, 2022
1e4d2b0
Add correct InetAccess category to HttpClientTest.Proxy_Disabled test
akoeplinger Jan 19, 2022
336e058
Add missing handle function enter/return macros (#21405)
Jan 24, 2022
c3ef03b
Determine any memory/CPU limitations from sysfs cgroup (#21280)
nealef Jan 25, 2022
3c5530d
[AOT] Use .short directive instead of .hword (#21416)
grendello Feb 1, 2022
bc0fdf5
Avoid an assert in ves_icall_RuntimeFieldInfo_SetValueInternal (#21410)
monojenkins Feb 2, 2022
0cefee0
vtable setup fix for generic default interface methods in mono runtim…
monojenkins Feb 7, 2022
7ba60f0
[mono] Fix StackTrace from a dim and Vtable offsets for static interf…
monojenkins Feb 8, 2022
a4ba9f0
[Tools] Fix mono-api-html MarkdownFormatter.cs to avoid a NRE (#21430)
mandel-macaque Feb 14, 2022
475a5a1
Disable ClientWebSocketTest tests that started failing for no reason
akoeplinger Feb 17, 2022
6b6df02
[Android] Workaround for invalid return value from clock_nanosleep (#…
simonrozsival Feb 17, 2022
917cb9f
Add issue templates with links to .NET 6 products (#21437)
lambdageek Feb 18, 2022
09270ec
[mono] Throw a MarshalDirectiveException when marshalling generic ins…
vargaz Feb 22, 2022
f88ae6d
Fix leak in mono_marshal_get_managed_wrapper
akoeplinger Feb 24, 2022
7054c89
Bump corefx submodule to get brotli update
akoeplinger Mar 22, 2022
56c20f8
[AOT] Don't set the 'CorrectedSynthesize' flag in the objc_imageinfo …
rolfbjarne Apr 19, 2022
9097095
Use upstream zlib 1.2.12 (#21458)
lambdageek Apr 20, 2022
67e1efe
[mono] Remove some of the restrictions on constrained calls from gsha…
vargaz May 6, 2022
e656341
Bump corefx to get MaxResponseHeadersLength fix (#21474)
steveisok May 16, 2022
440fc28
[mono] Fix a crash during stack trace construction if a this object i…
bholmes May 24, 2022
0b08883
Set app context to null on thread detach (#21482)
bholmes May 24, 2022
acf3932
Bump nuget.exe to v6.2.1
akoeplinger Jun 14, 2022
7a0e8c3
[debugger] Fix debugging on Mac and iOS (#21516)
thaystg Jul 14, 2022
14c5604
[ci] Sync backport action code with dotnet/runtime
akoeplinger Jul 14, 2022
ca87cd3
Backporting https://github.com/dotnet/runtime/pull/59861 (#21531)
ivanpovazan Aug 4, 2022
388470a
[ci] Use latest macOS and Ubuntu images for mono-mono-signing.yml
akoeplinger Sep 1, 2022
9fd9c85
CGroup fix to match coreCLR PR 64128 (#21503)
nealef Sep 2, 2022
b82af7e
GitHub Workflows security hardening (#21544)
sashashura Sep 2, 2022
bd1d5dc
Avoid a crash when the debugger code fails to lookup the signature (#…
bholmes Sep 2, 2022
12d97d0
Sync backport.yml changes from dotnet/runtime
akoeplinger Sep 29, 2022
4eb0191
[ci] Update to new macOS and Ubuntu AzDO images (#21542)
akoeplinger Oct 3, 2022
2307343
egrep/fgrep are deprecated and obsolete (#21551)
signed-log Oct 3, 2022
e038806
Update docker tags to the new schema (#21552)
dkurepa Oct 4, 2022
83426f9
Fix wrong change in backport.yml
akoeplinger Oct 6, 2022
05bd98b
Fix incorrect version comparison in loader (#21553)
uweigand Oct 6, 2022
fdc57cc
Bump nuget.exe to v6.3.1
akoeplinger Oct 12, 2022
e81f877
Fix OP_CHECK_THIS - matches PR#76916 for dotnet runtime (#21562)
nealef Oct 12, 2022
0db5774
Bump NuGetSdkResolver in msbuild
akoeplinger Oct 13, 2022
b23496f
Fix default value to be 20MB (#21573)
nealef Nov 1, 2022
08b6f99
Change download URL for PCL reference assemblies
akoeplinger Nov 2, 2022
516467a
Fix build on macOS 13 / Xcode 14 (#21597)
akoeplinger Dec 20, 2022
949ddf7
Disable a failing test
akoeplinger Dec 20, 2022
b8ef1c0
[WindowsBase] System.IO.Packaging.Package.Open truncate on FileMode.C…
TheCakeIsNaOH Dec 21, 2022
2059437
Fix url to gtksharp msi
akoeplinger Dec 23, 2022
f20b7fd
Fixed issue where errorcode would not propogate back to Managed if th…
UnityAlex Jan 13, 2023
778b0fe
[mono][loader] Set status on success; avoid mmap on Android (#21609)
lambdageek Jan 25, 2023
22d6da2
Fix mono arm assert with large return structs (#21577)
bholmes Mar 10, 2023
9287017
[mono] Use `unsigned char` when computing UTF8 string hashes (#21632)
lambdageek Mar 13, 2023
c91e74e
fix aarch64+clang compilation errors (#21642)
lexi-nadia Apr 17, 2023
a968904
Remove sdks/ directory to reduce confusion (#21647)
akoeplinger Apr 24, 2023
aeeba70
Fix xar download url
akoeplinger May 5, 2023
94cd3b2
Use different xar tarball
akoeplinger May 5, 2023
ae33da3
Switch back to original xar version
akoeplinger May 5, 2023
6cb8071
Fix xar url again
akoeplinger May 6, 2023
5b6cd76
[debugger] Ports from dotnet/runtime to maintain compatibility (#21653)
mauroa May 15, 2023
39354bd
Fixed compile errors when DEBUG is defined (#21656)
mollstam May 16, 2023
9bf8042
[WinForms] Improve compatibility of property grid custom editors (#21…
glopesdev Jun 1, 2023
6488a3a
Bump nuget.exe to v6.6.1
akoeplinger Jun 14, 2023
d7ed257
[Mono.Security] Add additional validation to AuthenticodeDeformatter
akoeplinger Jul 11, 2023
6787e34
[Mono.Security] Adjust test after EKU fix
akoeplinger Jul 24, 2023
6fc5ca7
[libs] Update TimeZoneInfo to read new version of tzdata (#21682)
mdh1418 Jul 21, 2023
40938b4
[libs][TimeZoneInfo] Bound transition time conversion (#21685)
mdh1418 Jul 26, 2023
cf4e09d
Remove DbLinq/sqlmetal unused .csproj files
akoeplinger Aug 1, 2023
18ab5b5
Merge commit '89f1d3cc22fd3b0848ecedbd6215b0bdfeea9477'
ThomasKuehne Mar 23, 2024
60fd41b
Merge commit '38b0227c1ce0c53058a5d78d080923435132773a'
ThomasKuehne Mar 23, 2024
03de654
Merge remote-tracking branch 'mono/main'
ThomasKuehne Mar 23, 2024
f280ac6
This change is released under the MIT license.
ThomasKuehne Mar 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,8 @@ System.Windows.Forms/X11Clipboard.cs
System.Windows.Forms/X11DesktopColors.cs
System.Windows.Forms/X11Dnd.cs
System.Windows.Forms/X11Keyboard.cs
System.Windows.Forms/X11Selection.cs
System.Windows.Forms/X11SelectionHandler.cs
System.Windows.Forms/X11Structs.cs
System.Windows.Forms/XEventQueue.cs
System.Windows.Forms/XplatUI.cs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ private static bool ConvertFromClipboardData(int type, IntPtr data, out object o
#region Public Static Methods
public static void Clear ()
{
IntPtr clipboard_handle;

clipboard_handle = XplatUI.ClipboardOpen (false);
XplatUI.ClipboardStore (clipboard_handle, null, 0, null, false);
ClearImpl (false);
}

public static bool ContainsAudio ()
Expand Down Expand Up @@ -144,7 +141,26 @@ public static StringCollection GetFileDropList ()
if (data == null)
return null;

return (StringCollection)data.GetData (DataFormats.FileDrop, true);
// CAUTION: DataFormats.FileDrop has multiple storage types
// string[] - Carbon, X11, Win32
// StringCollection - SetFileDropList
// support both here
string[] array;
StringCollection collection;

object raw = data.GetData (DataFormats.FileDrop, true);

if (raw != null) {
array = raw as string[];
if (array != null) {
collection = new StringCollection ();
collection.AddRange (array);
} else
collection = raw as StringCollection;
} else
collection = null;

return collection;
}

public static Image GetImage ()
Expand Down Expand Up @@ -231,15 +247,20 @@ public static void SetDataObject(object data, bool copy) {
SetDataObject(data, copy, 10, 100); // MSDN says default behavior is to try 10 times with 100 ms delay
}

internal static void SetDataObjectImpl(object data, bool copy) {
internal static void SetDataObjectImpl(object data, bool copy, bool primary_selection = false) {
if (XplatUI.ClipboardSetContent != null) {
XplatUI.ClipboardSetContent (primary_selection, data, copy);
return;
}

IntPtr clipboard_handle;
XplatUI.ObjectToClipboard converter;
int native_format;
DataFormats.Format item_format;

converter = new XplatUI.ObjectToClipboard(ConvertToClipboardData);

clipboard_handle = XplatUI.ClipboardOpen(false);
clipboard_handle = XplatUI.ClipboardOpen(primary_selection);
XplatUI.ClipboardStore(clipboard_handle, null, 0, null, copy); // Empty clipboard

native_format = -1;
Expand Down Expand Up @@ -363,8 +384,24 @@ public static void SetText (string text, TextDataFormat format)
#endregion // Public Static Methods

#region Internal Static Methods
internal static IDataObject GetDataObject (bool primary_selection)
internal static void ClearImpl (bool primary_selection = false)
{
if (XplatUI.ClipboardClear != null) {
XplatUI.ClipboardClear (primary_selection);
return;
}

IntPtr clipboard_handle;

clipboard_handle = XplatUI.ClipboardOpen (primary_selection);
XplatUI.ClipboardStore (clipboard_handle, null, 0, null, false);
}

internal static IDataObject GetDataObject (bool primary_selection = false)
{
if (XplatUI.ClipboardGetContent != null)
return XplatUI.ClipboardGetContent (primary_selection);

DataObject clipboard;
IntPtr clipboard_handle;
int[] native_formats;
Expand Down Expand Up @@ -406,11 +443,29 @@ internal static IDataObject GetDataObject (bool primary_selection)

internal static bool ClipboardContainsFormat (params string[] formats)
{
return ClipboardContainsFormat (false, formats);
}

internal static bool ClipboardContainsFormat (bool primary_selection, params string[] formats)
{
if (XplatUI.ClipboardGetFormats != null) {
string[] available = XplatUI.ClipboardGetFormats (primary_selection);
if (available == null)
return false;

foreach (string native in available)
foreach (string wanted in formats)
if (string.Equals(native, wanted, StringComparison.OrdinalIgnoreCase))
return true;

return false;
}

IntPtr clipboard_handle;
int[] native_formats;
DataFormats.Format item_format;

clipboard_handle = XplatUI.ClipboardOpen (false);
clipboard_handle = XplatUI.ClipboardOpen (primary_selection);
native_formats = XplatUI.ClipboardAvailableFormats (clipboard_handle);

if (native_formats == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,26 @@ public virtual bool GetDataPresent(Type format) {

public virtual StringCollection GetFileDropList ()
{
return (StringCollection)GetData (DataFormats.FileDrop, true);
// CAUTION: DataFormats.FileDrop has multiple storage types
// string[] - Carbon, X11, Win32
// StringCollection - SetFileDropList
// support both here
string[] array;
StringCollection collection;

object raw = GetData (DataFormats.FileDrop, true);

if (raw != null) {
array = raw as string[];
if (array != null) {
collection = new StringCollection ();
collection.AddRange (array);
} else
collection = raw as StringCollection;
} else
collection = null;

return collection;
}
public virtual string[] GetFormats() {
return GetFormats(true);
Expand Down
Loading
Loading