iOS: set active window upon calls to requestActiveWindow

We did not do this from before. Instead we would activate
the window when it's view became first responder. And this
would happen when the input panel was told to open.
That behavior is a fragile, since other layers higher
up (qml) would not open the input panel unless the window
was active, which also makes sense. A classic chicken and
egg problem.

So to play more along with how Qt is expected to work, we
change behavior to instead activate the window directly
when requested to do so (which also includes when the user
touches the window directly). This will also work better
for "keyboard" events like Key_VolumeUp, once implemented.

The down side is that Qt will give focus to widgets/items
(and as such, open the keyboard) whenever you touch the
window. But that is easier to fix, and will be dealt with
in later patches.

Change-Id: I9bbeb0205e7ea3c5079100c07e40ddb1c60b476b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Richard Moe Gustavsen 2013-10-29 14:11:33 +01:00 committed by The Qt Project
parent 1d54a502dd
commit 6272a816d1

View File

@ -440,6 +440,7 @@ void QIOSWindow::requestActivateWindow()
raise();
QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext();
static_cast<QIOSInputContext *>(context)->focusViewChanged(m_view);
QWindowSystemInterface::handleWindowActivated(window());
}
void QIOSWindow::raiseOrLower(bool raise)