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

PointerPointUpdateKind + KeyModifiers #2829

Merged
merged 6 commits into from Aug 16, 2019
Merged

PointerPointUpdateKind + KeyModifiers #2829

merged 6 commits into from Aug 16, 2019

Conversation

kekekeks
Copy link
Member

Continue moving towards UWP-style API

@kekekeks kekekeks requested a review from a team August 10, 2019 09:12
@wieslawsoltes
Copy link
Contributor

@kekekeks While testing this PR exception is thrown:

System.ArgumentException
  HResult=0x80070057
  Message=The argument type, 'Avalonia.Input.InputModifiers', is not the same as the enum type 'Avalonia.Input.RawInputModifiers'.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Enum.HasFlag(Enum flag)
   at Avalonia.Platform.InProcessDragSource.<ProcessMouseEvents>g__CheckDraggingAccepted|20_0(InputModifiers changedMouseButton, <>c__DisplayClass20_0& )
   at Avalonia.Platform.InProcessDragSource.ProcessMouseEvents(RawPointerEventArgs e)
   at System.Reactive.AnonymousSafeObserver`1.OnNext(T value) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\AnonymousSafeObserver.cs:line 46
   at System.Reactive.Observer`1.OnNext(T value) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\Observers.cs:line 80
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e)
   at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at AvaloniaDemo.Program.Main(String[] args) in C:\DOWNLOADS\GitHub\Dock\samples\AvaloniaDemo\Program.cs:line 12

@wieslawsoltes
Copy link
Contributor

wieslawsoltes commented Aug 10, 2019

@kekekeks Seems to be fixed now.

It would be great to have some sample code showing how to use pointer properties in breaking changes. I had hard time figuring out the pointer properties.

Is this correct use:

wieslawsoltes/Dock@64d4a83

@kekekeks
Copy link
Member Author

some sample code showing how to use pointer properties

I'm just following the UWP API

The code should work, but it's probably better to use PointerUpdateKind in your case. There is another problem in the drag behavior: it assumes that there is only one pointer, which is no longer the case. For now I'd recommend to check for the pointer type, since our drag-n-drop code doesn't work with touch pointers anyway.

@kekekeks kekekeks merged commit f079e65 into master Aug 16, 2019
@kekekeks kekekeks deleted the pointerpoint branch August 16, 2019 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants