diff options
Diffstat (limited to 'src/plugins/platforms/ios/qioswindow.mm')
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index aa33a9b21d..1c9fc6f28a 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -178,24 +178,7 @@ void QIOSWindow::applyGeometry(const QRect &rect) // The baseclass takes care of persisting this for us. QPlatformWindow::setGeometry(rect); - if (window()->isTopLevel()) { - // The QWindow is in QScreen coordinates, which maps to a possibly rotated root-view-controller. - // Since the root-view-controller might be translated in relation to the UIWindow, we need to - // check specifically for that and compensate. Also check if the root view has been scrolled - // as a result of the keyboard being open. - UIWindow *uiWindow = m_view.window; - UIView *rootView = uiWindow.rootViewController.view; - CGRect rootViewPositionInRelationToRootViewController = - [rootView convertRect:uiWindow.bounds fromView:uiWindow]; - - m_view.frame = CGRectOffset([m_view.superview convertRect:toCGRect(rect) fromView:rootView], - rootViewPositionInRelationToRootViewController.origin.x, - rootViewPositionInRelationToRootViewController.origin.y - + rootView.bounds.origin.y); - } else { - // Easy, in parent's coordinates - m_view.frame = toCGRect(rect); - } + m_view.frame = toCGRect(rect); // iOS will automatically trigger -[layoutSubviews:] for resize, // but not for move, so we force it just in case. @@ -264,12 +247,12 @@ void QIOSWindow::requestActivateWindow() if (blockedByModal()) return; + Q_ASSERT(m_view.window); [m_view.window makeKeyWindow]; + [m_view becomeFirstResponder]; if (window()->isTopLevel()) raise(); - - QWindowSystemInterface::handleWindowActivated(window()); } void QIOSWindow::raiseOrLower(bool raise) |