Skip to content

Commit

Permalink
chore: make X11's PointerPointProperties. PointerUpdateKind accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed Jul 31, 2024
1 parent 15b05ea commit ab52a98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Uno.UI.Runtime.Skia.X11/X11PointerInputSource.Mouse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Windows.Foundation;
using Windows.UI.Input;
using Microsoft.UI.Xaml.Controls;

namespace Uno.WinUI.Runtime.Skia.X11;
Expand All @@ -16,6 +17,8 @@ internal partial class X11PointerInputSource
private Point _mousePosition;
private byte _pressedButtons; // // bit 0 is not used

private PointerPointProperties? _previousPointerPointProperties;

public void ProcessMotionNotifyEvent(XMotionEvent ev)
{
_mousePosition = new Point(ev.x, ev.y);
Expand Down
4 changes: 3 additions & 1 deletion src/Uno.UI.Runtime.Skia.X11/X11PointerInputSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ private PointerPoint CreatePointFromCurrentState(IntPtr time)
new Point(_mousePosition.X / scale, _mousePosition.Y / scale),
// TODO: is isInContact correct?
(_pressedButtons & 0b1111) != 0,
properties
properties.SetUpdateKindFromPrevious(_previousPointerPointProperties)
);

_previousPointerPointProperties = properties;

return point;
}
}

0 comments on commit ab52a98

Please sign in to comment.