Skip to content

Commit

Permalink
fix: Changed default PointerID to 1 to match UWP
Browse files Browse the repository at this point in the history
  • Loading branch information
trungnt2910 committed Apr 27, 2021
1 parent f0b29e3 commit 0a30b82
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Uno.UI.Runtime.Skia.Gtk/GtkCoreWindowExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private static PointerEventArgs AsPointerArgs(Event evt)
var position = new Windows.Foundation.Point(x, y);
EventHelper.GetState(evt, out var state);

var pointerId = 0u;
var pointerId = 1u;
var modifiers = GetKeyModifiers(state);
var properties = new PointerPointProperties();

Expand Down
6 changes: 3 additions & 3 deletions src/Uno.UI.Runtime.Skia.Tizen/TizenCoreWindowExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void OnMove(GestureLayer.MomentumData data)
frameId: GetNextFrameId(),
timestamp: Math.Max(data.VerticalSwipeTimestamp, data.HorizontalSwipeTimestamp),
device: PointerDevice.For(PointerDeviceType.Touch),
pointerId: 0,
pointerId: 1,
rawPosition: point,
position: point,
isInContact: properties.HasPressedButton,
Expand Down Expand Up @@ -127,7 +127,7 @@ private void OnTapStart(GestureLayer.TapData data)
frameId: GetNextFrameId(),
timestamp: (uint)data.Timestamp,
device: PointerDevice.For(PointerDeviceType.Touch),
pointerId: 0,
pointerId: 1,
rawPosition: point,
position: point,
isInContact: properties.HasPressedButton,
Expand Down Expand Up @@ -157,7 +157,7 @@ private void OnTapEnd(GestureLayer.TapData data)
frameId: GetNextFrameId(),
timestamp: (uint)data.Timestamp,
device: PointerDevice.For(PointerDeviceType.Touch),
pointerId: 0,
pointerId: 1,
rawPosition: point,
position: point,
isInContact: properties.HasPressedButton,
Expand Down
12 changes: 6 additions & 6 deletions src/Uno.UI.Runtime.Skia.Wpf/WpfCoreWindowExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void HostOnMouseEnter(object sender, MouseEventArgs args)
frameId: GetNextFrameId(),
timestamp: (uint)args.Timestamp,
device: GetPointerDevice(args),
pointerId: 0,
pointerId: 1,
rawPosition: new Windows.Foundation.Point(position.X, position.Y),
position: new Windows.Foundation.Point(position.X, position.Y),
isInContact: properties.HasPressedButton,
Expand Down Expand Up @@ -161,7 +161,7 @@ private void HostOnMouseLeave(object sender, MouseEventArgs args)
frameId: GetNextFrameId(),
timestamp: (uint)args.Timestamp,
device: GetPointerDevice(args),
pointerId: 0,
pointerId: 1,
rawPosition: new Windows.Foundation.Point(position.X, position.Y),
position: new Windows.Foundation.Point(position.X, position.Y),
isInContact: properties.HasPressedButton,
Expand Down Expand Up @@ -191,7 +191,7 @@ private void HostOnMouseMove(object sender, MouseEventArgs args)
frameId: GetNextFrameId(),
timestamp: (uint)args.Timestamp,
device: GetPointerDevice(args),
pointerId: 0,
pointerId: 1,
rawPosition: new Windows.Foundation.Point(position.X, position.Y),
position: new Windows.Foundation.Point(position.X, position.Y),
isInContact: properties.HasPressedButton,
Expand Down Expand Up @@ -221,7 +221,7 @@ private void HostOnMouseDown(object sender, MouseButtonEventArgs args)
frameId: GetNextFrameId(),
timestamp: (uint)args.Timestamp,
device: GetPointerDevice(args),
pointerId: 0,
pointerId: 1,
rawPosition: new Windows.Foundation.Point(position.X, position.Y),
position: new Windows.Foundation.Point(position.X, position.Y),
isInContact: true,
Expand Down Expand Up @@ -251,7 +251,7 @@ private void HostOnMouseUp(object sender, MouseButtonEventArgs args)
frameId: GetNextFrameId(),
timestamp: (uint)args.Timestamp,
device: GetPointerDevice(args),
pointerId: 0,
pointerId: 1,
rawPosition: new Windows.Foundation.Point(position.X, position.Y),
position: new Windows.Foundation.Point(position.X, position.Y),
isInContact: properties.HasPressedButton,
Expand Down Expand Up @@ -320,7 +320,7 @@ private IntPtr OnWmMessage(IntPtr hwnd, int msg, IntPtr wparamOriginal, IntPtr l
frameId: GetNextFrameId(),
timestamp: (uint)Environment.TickCount,
device: PointerDevice.For(PointerDeviceType.Mouse),
pointerId: 0,
pointerId: 1,
rawPosition: position,
position: position,
isInContact: properties.HasPressedButton,
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/Controls/Window.macOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private static PointerPoint GetPointerPoint(NSEvent nativeEvent, Point posInWind
var pointerDevice = PointerDevice.For(pointerDeviceType);
var pointerId = pointerDeviceType == PointerDeviceType.Pen
? (uint)nativeEvent.PointingDeviceID()
: (uint)0;
: (uint)1;
var isInContact = GetIsInContact(nativeEvent);
var properties = GetPointerProperties(nativeEvent, pointerDeviceType);

Expand Down

0 comments on commit 0a30b82

Please sign in to comment.