fixed: unable to send touchPad widget to bottom in streamview

This commit is contained in:
TrueZhuanjia
2025-12-27 20:43:10 +08:00
parent 32ad5d2f8a
commit 2cf9fdfd40
+25
View File
@@ -593,6 +593,31 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
[widgetView setupInertialScroller];
}
}
uint64_t buttonIndex = 9999999;
UIView* deepestButton;
for (UIView *subview in self->streamFrameTopLayerView.subviews) {
if ([subview isKindOfClass:[OnScreenWidgetView class]]) {
OnScreenWidgetView* widget = (OnScreenWidgetView* ) subview;
if(widget.widgetType == WidgetTypeEnumButton){
uint64_t index = [self->streamFrameTopLayerView.subviews indexOfObject:subview];
if (index<buttonIndex){
buttonIndex = index;
deepestButton = subview;
}
}
}
}
if(!deepestButton) return;
for (UIView *subview in self->streamFrameTopLayerView.subviews) {
if ([subview isKindOfClass:[OnScreenWidgetView class]]) {
OnScreenWidgetView* widget = (OnScreenWidgetView* ) subview;
if(widget.widgetType == WidgetTypeEnumTouchPad){
[self->streamFrameTopLayerView insertSubview:subview belowSubview:deepestButton];
}
}
}
}
}