Browse Source
Merge pull request #1546 from boombuler/FixMouseCursorUpdate
force mousecursor if the mouse is over the window
pull/1190/head
Steven Kirk
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
2 deletions
-
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs
-
src/Windows/Avalonia.Win32/WindowImpl.cs
|
|
|
@ -870,6 +870,9 @@ namespace Avalonia.Win32.Interop |
|
|
|
return SetClassLong64(hWnd, nIndex, dwNewLong); |
|
|
|
} |
|
|
|
|
|
|
|
[DllImport("user32.dll", EntryPoint = "SetCursor")] |
|
|
|
internal static extern IntPtr SetCursor(IntPtr hCursor); |
|
|
|
|
|
|
|
[DllImport("ole32.dll", PreserveSig = true)] |
|
|
|
internal static extern int CoCreateInstance(ref Guid clsid, |
|
|
|
IntPtr ignore1, int ignore2, ref Guid iid, [MarshalAs(UnmanagedType.IUnknown), Out] out object pUnkOuter); |
|
|
|
|
|
|
|
@ -399,8 +399,11 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
public void SetCursor(IPlatformHandle cursor) |
|
|
|
{ |
|
|
|
UnmanagedMethods.SetClassLong(_hwnd, UnmanagedMethods.ClassLongIndex.GCL_HCURSOR, |
|
|
|
cursor?.Handle ?? DefaultCursor); |
|
|
|
var hCursor = cursor?.Handle ?? DefaultCursor; |
|
|
|
UnmanagedMethods.SetClassLong(_hwnd, UnmanagedMethods.ClassLongIndex.GCL_HCURSOR, hCursor); |
|
|
|
|
|
|
|
if (_owner.IsPointerOver) |
|
|
|
UnmanagedMethods.SetCursor(hCursor); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual IntPtr CreateWindowOverride(ushort atom) |
|
|
|
|