Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lindexi_gd
Uno
提交
2eca1603
U
Uno
项目概览
lindexi_gd
/
Uno
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
Uno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2eca1603
编写于
4月 14, 2023
作者:
D
David
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: Fix CI
上级
6e5090ab
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
62 addition
and
44 deletion
+62
-44
src/Uno.UI.RuntimeTests/Tests/Uno_UI_Xaml_Core/Given_InputManager.cs
...RuntimeTests/Tests/Uno_UI_Xaml_Core/Given_InputManager.cs
+3
-1
src/Uno.UI/UI/Xaml/Internal/PointerCapture.Managed.cs
src/Uno.UI/UI/Xaml/Internal/PointerCapture.Managed.cs
+19
-0
src/Uno.UI/UI/Xaml/Internal/PointerCapture.cs
src/Uno.UI/UI/Xaml/Internal/PointerCapture.cs
+21
-7
src/Uno.UI/UI/Xaml/Internal/PointerCapture.wasm.cs
src/Uno.UI/UI/Xaml/Internal/PointerCapture.wasm.cs
+16
-0
src/Uno.UI/UI/Xaml/Media/VisualTreeHelper.cs
src/Uno.UI/UI/Xaml/Media/VisualTreeHelper.cs
+3
-3
src/Uno.UI/UI/Xaml/UIElement.Pointers.Android.cs
src/Uno.UI/UI/Xaml/UIElement.Pointers.Android.cs
+0
-6
src/Uno.UI/UI/Xaml/UIElement.Pointers.Managed.cs
src/Uno.UI/UI/Xaml/UIElement.Pointers.Managed.cs
+0
-6
src/Uno.UI/UI/Xaml/UIElement.Pointers.cs
src/Uno.UI/UI/Xaml/UIElement.Pointers.cs
+0
-3
src/Uno.UI/UI/Xaml/UIElement.Pointers.iOS.cs
src/Uno.UI/UI/Xaml/UIElement.Pointers.iOS.cs
+0
-6
src/Uno.UI/UI/Xaml/UIElement.Pointers.wasm.cs
src/Uno.UI/UI/Xaml/UIElement.Pointers.wasm.cs
+0
-12
未找到文件。
src/Uno.UI.RuntimeTests/Tests/Uno_UI_Xaml_Core/Given_InputManager.cs
浏览文件 @
2eca1603
using
System
;
#
if
__SKIA__
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -54,3 +55,4 @@ public class Given_InputManager
Assert
.
IsFalse
(
failed
,
"The pointer should not have been dispatched to the col2 as it has been set to visibility collapsed."
);
}
}
#endif
src/Uno.UI/UI/Xaml/Internal/PointerCapture.Managed.cs
0 → 100644
浏览文件 @
2eca1603
#
if
UNO_HAS_MANAGED_POINTERS
#
nullable
enable
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Windows.UI.Xaml
;
using
Windows.UI.Xaml.Input
;
namespace
Uno.UI.Xaml.Core
;
internal
partial
class
PointerCapture
{
partial
void
CaptureNative
(
UIElement
target
,
Pointer
pointer
)
=>
target
.
XamlRoot
?.
VisualTree
.
ContentRoot
.
InputManager
!.
SetPointerCapture
(
pointer
.
UniqueId
);
partial
void
ReleaseNative
(
UIElement
target
,
Pointer
pointer
)
=>
target
.
XamlRoot
?.
VisualTree
.
ContentRoot
.
InputManager
!.
ReleasePointerCapture
(
pointer
.
UniqueId
);
}
#endif
src/Uno.UI/UI/Xaml/Internal/PointerCapture.cs
浏览文件 @
2eca1603
...
...
@@ -24,7 +24,7 @@ namespace Uno.UI.Xaml.Core;
/// <summary>
/// This is an helper class that use to manage the captures for a given pointer.
/// </summary>
internal
class
PointerCapture
internal
partial
class
PointerCapture
{
private
static
readonly
IDictionary
<
PointerIdentifier
,
PointerCapture
>
_actives
=
new
Dictionary
<
PointerIdentifier
,
PointerCapture
>(
EqualityComparer
<
PointerIdentifier
>.
Default
);
...
...
@@ -316,33 +316,47 @@ internal class PointerCapture
/// See https://github.com/dotnet/runtime/issues/56309
/// </remarks>
[
MethodImpl
(
MethodImplOptions
.
AggressiveInlining
)]
private
void
Releas
ePointerNative
()
private
void
Captur
ePointerNative
()
{
try
{
_nativeCaptureElement
?.
ReleasePointerNative
(
Pointer
);
if
(
_nativeCaptureElement
is
not
null
)
{
CaptureNative
(
_nativeCaptureElement
,
Pointer
);
}
}
catch
(
Exception
e
)
{
this
.
Log
().
Error
(
$"Failed to
release native capture of
{
Pointer
}
"
,
e
);
this
.
Log
().
Error
(
$"Failed to
capture natively pointer
{
Pointer
}
.
"
,
e
);
}
}
// Implement this to get pointer capture out of the bounds of the app
[
MethodImpl
(
MethodImplOptions
.
AggressiveInlining
)]
partial
void
CaptureNative
(
UIElement
target
,
Pointer
pointer
);
/// <remarks>
/// This method contains or is called by a try/catch containing method and
/// can be significantly slower than other methods as a result on WebAssembly.
/// See https://github.com/dotnet/runtime/issues/56309
/// </remarks>
[
MethodImpl
(
MethodImplOptions
.
AggressiveInlining
)]
private
void
Captur
ePointerNative
()
private
void
Releas
ePointerNative
()
{
try
{
_nativeCaptureElement
?.
CapturePointerNative
(
Pointer
);
if
(
_nativeCaptureElement
is
not
null
)
{
ReleaseNative
(
_nativeCaptureElement
,
Pointer
);
}
}
catch
(
Exception
e
)
{
this
.
Log
().
Error
(
$"Failed to
capture natively pointer
{
Pointer
}
.
"
,
e
);
this
.
Log
().
Error
(
$"Failed to
release native capture of
{
Pointer
}
"
,
e
);
}
}
// Implement this to get pointer capture out of the bounds of the app
[
MethodImpl
(
MethodImplOptions
.
AggressiveInlining
)]
partial
void
ReleaseNative
(
UIElement
target
,
Pointer
pointer
);
}
src/Uno.UI/UI/Xaml/Internal/PointerCapture.wasm.cs
0 → 100644
浏览文件 @
2eca1603
#
nullable
enable
using
System
;
using
System.Linq
;
using
Windows.UI.Xaml
;
namespace
Uno.UI.Xaml.Core
;
internal
partial
class
PointerCapture
{
partial
void
CapturePointerNative
(
UIElement
target
,
Pointer
pointer
)
=>
WindowManagerInterop
.
SetPointerCapture
(
target
.
HtmlId
,
pointer
.
PointerId
);
partial
void
ReleasePointerNative
(
UIElement
target
,
Pointer
pointer
)
=>
WindowManagerInterop
.
ReleasePointerCapture
(
target
.
HtmlId
,
pointer
.
PointerId
);
}
src/Uno.UI/UI/Xaml/Media/VisualTreeHelper.cs
浏览文件 @
2eca1603
...
...
@@ -622,7 +622,7 @@ namespace Windows.UI.Xaml.Media
}
}
#region Helpers
#
region
Helpers
private
static
Func
<
IEnumerable
<
UIElement
>,
IEnumerable
<
UIElement
>>
Except
(
UIElement
element
)
=>
children
=>
children
.
Except
(
element
);
...
...
@@ -678,9 +678,9 @@ namespace Windows.UI.Xaml.Media
internal
static
IEnumerable
<
UIElement
>
GetManagedVisualChildren
(
_View
view
)
=>
view
.
GetChildren
().
OfType
<
UIElement
>();
#endif
#endregion
#
endregion
#region HitTest tracing
#
region
HitTest
tracing
#if TRACE_HIT_TESTING
[
ThreadStatic
]
private
static
StringBuilder
?
_trace
;
...
...
src/Uno.UI/UI/Xaml/UIElement.Pointers.Android.cs
浏览文件 @
2eca1603
...
...
@@ -237,12 +237,6 @@ namespace Windows.UI.Xaml
};
}
#
region
Capture
// No needs to explicitly capture pointers on Android, they are implicitly captured
// partial void CapturePointerNative(Pointer pointer);
// partial void ReleasePointerNative(Pointer pointer);
#
endregion
partial
void
OnIsHitTestVisibleChangedPartial
(
bool
oldValue
,
bool
newValue
)
{
base
.
SetNativeIsHitTestVisible
(
newValue
);
...
...
src/Uno.UI/UI/Xaml/UIElement.Pointers.Managed.cs
浏览文件 @
2eca1603
...
...
@@ -103,12 +103,6 @@ namespace Windows.UI.Xaml
}
#
endregion
internal
partial
void
CapturePointerNative
(
Pointer
pointer
)
=>
XamlRoot
?.
VisualTree
.
ContentRoot
.
InputManager
!.
SetPointerCapture
(
pointer
.
UniqueId
);
internal
partial
void
ReleasePointerNative
(
Pointer
pointer
)
=>
XamlRoot
?.
VisualTree
.
ContentRoot
.
InputManager
!.
ReleasePointerCapture
(
pointer
.
UniqueId
);
}
}
#endif
src/Uno.UI/UI/Xaml/UIElement.Pointers.cs
浏览文件 @
2eca1603
...
...
@@ -1441,9 +1441,6 @@ namespace Windows.UI.Xaml
}
#
endregion
internal
partial
void
CapturePointerNative
(
Pointer
pointer
);
internal
partial
void
ReleasePointerNative
(
Pointer
pointer
);
private
bool
ValidateAndUpdateCapture
(
PointerRoutedEventArgs
args
)
=>
ValidateAndUpdateCapture
(
args
,
IsOver
(
args
.
Pointer
));
...
...
src/Uno.UI/UI/Xaml/UIElement.Pointers.iOS.cs
浏览文件 @
2eca1603
...
...
@@ -441,11 +441,5 @@ namespace Windows.UI.Xaml
}
}
#
endregion
#
region
Capture
// Pointer capture is not needed on iOS, otherwise we could use ExclusiveTouch = true;
// partial void CapturePointerNative(Pointer pointer);
// partial void ReleasePointerNative(Pointer pointer);
#
endregion
}
}
src/Uno.UI/UI/Xaml/UIElement.Pointers.wasm.cs
浏览文件 @
2eca1603
...
...
@@ -340,18 +340,6 @@ public partial class UIElement : DependencyObject
}
}
#
region
Capture
partial
void
CapturePointerNative
(
Pointer
pointer
)
{
WindowManagerInterop
.
SetPointerCapture
(
HtmlId
,
pointer
.
PointerId
);
}
partial
void
ReleasePointerNative
(
Pointer
pointer
)
{
WindowManagerInterop
.
ReleasePointerCapture
(
HtmlId
,
pointer
.
PointerId
);
}
#
endregion
#
region
HitTestVisibility
internal
void
UpdateHitTest
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录