tweak qos for async native touch

This commit is contained in:
TrueZhuangjia
2025-04-04 16:39:00 +08:00
committed by TrueZhuanjia
parent 2712922ce5
commit a43fe609d3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -208,7 +208,7 @@
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
if (asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
if (asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
for (UITouch* touch in touches){
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
@@ -232,7 +232,7 @@
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if(asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
if(asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
for (UITouch* touch in touches){
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
+2 -2
View File
@@ -203,7 +203,7 @@
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
if (asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
if (asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
for (UITouch* touch in touches){
if(self->activateCoordSelector) [self updatePointerObjInDict:touch];
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_MOVE];
@@ -223,7 +223,7 @@
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if(asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
if(asyncNativeTouch) dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
for (UITouch* touch in touches){
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_UP]; //send touch event before remove pointerId
[self removePointerId:touch]; //then remove pointerId