Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure our touch/point conversion works in middleware (C#-hosted, … #1821

Merged
merged 1 commit into from
Jan 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Frameworks/UIKit/UIView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import <StubReturn.h>
#import "Starboard.h"

#import <UIKit/UIApplication.h>
#import <UIKit/UIGraphics.h>
#import <UIKit/UIImage.h>
#import <UIKit/UIImageView.h>
Expand All @@ -39,6 +40,7 @@
#import "UIWindowInternal.h"
#import "UIViewControllerInternal.h"
#import "UIGestureRecognizerInternal.h"
#import "CACompositor.h"
#import "CALayerInternal.h"
#import "CAAnimationInternal.h"
#import "CGContextInternal.h"
Expand Down Expand Up @@ -2299,6 +2301,13 @@ - (UIWindow*)_getWindowInternal {
}

if (!priv->superview) {
// This is probably safe to do in all cases, but for now, let's constrain
Copy link
Contributor

@yiyang-msft yiyang-msft Jan 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably safe to do in all cas [](start = 18, length = 31)

agreed. #Resolved

// this to middleware scenarios. We need to return a window in such cases
// so point/rect/etc. conversion works properly.
if (GetCACompositor()->IsRunningAsFramework()) {
return [[UIApplication sharedApplication] keyWindow];
}

return nil;
}

Expand Down