Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,4 @@ src/Browser/Avalonia.Browser.Blazor/wwwroot
src/Browser/Avalonia.Browser/wwwroot
api/diff
src/Browser/Avalonia.Browser/staticwebassets
/.nuke/temp/dotnet-win/host/fxr/8.0.11/hostfxr.dll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add /.nuke/temp/ instead

32 changes: 32 additions & 0 deletions src/Avalonia.X11/DragNDrop/DragDropEffectsExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using Avalonia.Input;

namespace Avalonia.X11
{
internal static class DragDropEffectsExtensions
{
public static DragDropEffects ConvertDropEffect(this X11Atoms atoms, IntPtr effect)
{
DragDropEffects result = DragDropEffects.None;
if (((uint)effect & (uint)(atoms.XdndActionCopy)) == (uint)atoms.XdndActionCopy)
result |= DragDropEffects.Copy;
if (((uint)effect & (uint)(atoms.XdndActionMove)) == (uint)atoms.XdndActionMove)
result |= DragDropEffects.Move;
if (((uint)effect & (uint)(atoms.XdndActionLink)) == (uint)atoms.XdndActionLink)
result |= DragDropEffects.Link;
return result;
}

public static IntPtr ConvertDropEffect(this X11Atoms atoms, DragDropEffects operation)
{
uint result = (uint)IntPtr.Zero;
if (operation.HasAllFlags(DragDropEffects.Copy))
result |= (uint)atoms.XdndActionCopy;
if (operation.HasAllFlags(DragDropEffects.Move))
result |= (uint)atoms.XdndActionMove;
if (operation.HasAllFlags(DragDropEffects.Link))
result |= (uint)atoms.XdndActionLink;
return (IntPtr)result;
}
}
}
Loading
Loading