summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-08-24 16:37:34 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-08-28 11:29:37 +0000
commit7010da2e6274febf71db40a535ce1d0c4858f143 (patch)
tree131af04a0b45d1814a778e875151fcfb105b1da9 /src
parent064439eae4942e5aec1f1819d8f60fee9514baae (diff)
iOS: Make setFrame in desktop view take superview transforms into account
An assumption we do for the QIOSDesktopManagerView is that it should always cover the whole UIWindow. To achieve that, we override setFrame to be stop any attempt from UIKit to make our view smaller, e.g. when the statusbar changes height. In case the view is not a direct child of the window, we need to take any transformations into account when computing the new frame. This happens e.g. during presentation of other view-controllers, where our view is temporarily reparented into a UITransitionView that may have a transform set. Task-number: QTBUG-47506 Change-Id: I388143f2cbb566541ffb1068443ce21e62ea2b42 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/ios/qiosviewcontroller.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm
index a7068b9246..62f5387979 100644
--- a/src/plugins/platforms/ios/qiosviewcontroller.mm
+++ b/src/plugins/platforms/ios/qiosviewcontroller.mm
@@ -185,7 +185,14 @@
- (void)setFrame:(CGRect)newFrame
{
- [super setFrame:CGRectMake(0, 0, CGRectGetWidth(newFrame), CGRectGetHeight(self.window.bounds))];
+ Q_UNUSED(newFrame);
+ Q_ASSERT(!self.window || self.window.rootViewController.view == self);
+
+ // When presenting view controllers our view may be temporarily reparented into a UITransitionView
+ // instead of the UIWindow, and the UITransitionView may have a transform set, so we need to do a
+ // mapping even if we still expect to always be the root view-controller.
+ CGRect transformedWindowBounds = [self.superview convertRect:self.window.bounds fromView:self.window];
+ [super setFrame:transformedWindowBounds];
}
- (void)setBounds:(CGRect)newBounds