summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2014-08-11 16:06:47 +0200
committerPaul Olav Tvete <paul.tvete@digia.com>2014-08-13 09:16:53 +0200
commitc0556d92f3415b478da4aff24f6f5545df394983 (patch)
treee690e532cbc9f92b998b5ffd24a042e00784f3ca /src/gui/kernel
parent4e6ebabb305e47a7fd20c510e79715ef912a924a (diff)
Android: don't kill the app without warning
If the back key was pressed when no window was visible, such as during startup, the app would be killed without notice. This change makes sure that we always give the app a chance to intercept the back key before killing the application. [ChangeLog][Android] Back key no longer kills the application when no window is visible. Task-number: QTBUG-39688 Change-Id: If9373e8d26ff323d8c8a274fb30820ecc4ca66ab Reviewed-by: BogDan Vatra <bogdan@kde.org>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qguiapplication.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 831ebd19c0..9155abf8b9 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1889,9 +1889,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
if (e->keyType == QEvent::KeyPress) {
backKeyPressAccepted = e->key == Qt::Key_Back && ev.isAccepted();
} else if (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back && !backKeyPressAccepted && !ev.isAccepted()) {
- if (!window)
- qApp->quit();
- else
+ if (window)
QWindowSystemInterface::handleCloseEvent(window);
}
#endif