fix: lift stream view for metal renderer when OSK is invoked
This commit is contained in:
1 parent
9b9f4f7603
commit
131d115761
2 files changed
+46
No files matched your search
@@ -63,6 +63,7 @@
|
|||||||
-(void)readyToBringUpSoftKeyboardByToolbox;
|
-(void)readyToBringUpSoftKeyboardByToolbox;
|
||||||
- (void)keyboardWillShow:(NSNotification *)notification;
|
- (void)keyboardWillShow:(NSNotification *)notification;
|
||||||
- (void)keyboardWillHide;
|
- (void)keyboardWillHide;
|
||||||
|
- (void)liftMetalVideoViewIfNeeded:(CGFloat)liftHeight;
|
||||||
|
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
- (void) updateCursorLocation:(CGPoint)location isMouse:(BOOL)isMouse;
|
- (void) updateCursorLocation:(CGPoint)location isMouse:(BOOL)isMouse;
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
#import "StreamView.h"
|
#import "StreamView.h"
|
||||||
#include <Limelight.h>
|
#include <Limelight.h>
|
||||||
#import "DataManager.h"
|
#import "DataManager.h"
|
||||||
|
#import "TemporarySettings.h"
|
||||||
|
#import "Plot.h"
|
||||||
#import "ControllerSupport.h"
|
#import "ControllerSupport.h"
|
||||||
#import "KeyboardSupport.h"
|
#import "KeyboardSupport.h"
|
||||||
#import "VoidLink-Swift.h"
|
#import "VoidLink-Swift.h"
|
||||||
@@ -244,6 +246,10 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
CGRect liftedStreamFrame = self.frame;
|
CGRect liftedStreamFrame = self.frame;
|
||||||
liftedStreamFrame.origin.y -= HeightViewLiftedTo;
|
liftedStreamFrame.origin.y -= HeightViewLiftedTo;
|
||||||
self.frame = liftedStreamFrame;
|
self.frame = liftedStreamFrame;
|
||||||
|
|
||||||
|
// Also lift Metal video view if using Metal rendering backend
|
||||||
|
[self liftMetalVideoViewIfNeeded:HeightViewLiftedTo];
|
||||||
|
|
||||||
isInputingText = true;
|
isInputingText = true;
|
||||||
[self refreshKeyboardToggleRecognizer:settings.keyboardToggleFingers.intValue];
|
[self refreshKeyboardToggleRecognizer:settings.keyboardToggleFingers.intValue];
|
||||||
[keyboardToggleTip removeFromSuperview];
|
[keyboardToggleTip removeFromSuperview];
|
||||||
@@ -258,10 +264,49 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
keyboardToggleRecognizer.numberOfTouchesRequired = settings.keyboardToggleFingers.intValue; // reset this number
|
keyboardToggleRecognizer.numberOfTouchesRequired = settings.keyboardToggleFingers.intValue; // reset this number
|
||||||
if(isInputingText){
|
if(isInputingText){
|
||||||
self.frame = _originalFrame;
|
self.frame = _originalFrame;
|
||||||
|
|
||||||
|
// Also restore Metal video view if using Metal rendering backend
|
||||||
|
[self liftMetalVideoViewIfNeeded:0];
|
||||||
|
|
||||||
isInputingText = NO;
|
isInputingText = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)liftMetalVideoViewIfNeeded:(CGFloat)liftHeight {
|
||||||
|
// Check if we're using Metal rendering backend
|
||||||
|
DataManager* dataMan = [[DataManager alloc] init];
|
||||||
|
TemporarySettings* currentSettings = [dataMan getSettings];
|
||||||
|
|
||||||
|
if ([currentSettings.renderingBackend intValue] == RENDER_METAL) {
|
||||||
|
// Find the StreamFrameViewController that contains the MetalViewController
|
||||||
|
UIViewController* parentVC = nil;
|
||||||
|
UIResponder* responder = self.streamFrameTopLayerView;
|
||||||
|
while (responder && ![responder isKindOfClass:[UIViewController class]]) {
|
||||||
|
responder = [responder nextResponder];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([responder isKindOfClass:[UIViewController class]]) {
|
||||||
|
parentVC = (UIViewController*)responder;
|
||||||
|
|
||||||
|
// Check if this is StreamFrameViewController with metalViewController property
|
||||||
|
if ([parentVC respondsToSelector:@selector(metalViewController)]) {
|
||||||
|
id metalViewController = [parentVC performSelector:@selector(metalViewController)];
|
||||||
|
|
||||||
|
if (metalViewController && [metalViewController respondsToSelector:@selector(view)]) {
|
||||||
|
UIView* metalView = [metalViewController performSelector:@selector(view)];
|
||||||
|
|
||||||
|
if (metalView) {
|
||||||
|
CGRect metalFrame = metalView.frame;
|
||||||
|
metalFrame.origin.y = liftHeight > 0 ? -liftHeight : 0;
|
||||||
|
metalView.frame = metalFrame;
|
||||||
|
NSLog(@"Lifted Metal video view by %f pixels", liftHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-(void)readyToBringUpSoftKeyboardByToolbox{
|
-(void)readyToBringUpSoftKeyboardByToolbox{
|
||||||
NSLog(@"change num of fingers required");
|
NSLog(@"change num of fingers required");
|
||||||
[self refreshKeyboardToggleRecognizer:1];
|
[self refreshKeyboardToggleRecognizer:1];
|
||||||
|
|||||||
Reference in new issue
Block a user