From c97edb25796487c719376dd73c365603bcd68782 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Tue, 22 Apr 2014 08:51:40 +0300 Subject: WinRT: Handle back button as press or release Earlier, only the back press was checked for acceptance. By also checking the release event, this makes the backstepping behavior consistent with Qt for Android, and fixes the expected behavior found in our demo applications. Task-number: QTBUG-35951 Change-Id: I9c2f18816b838d57713ba4dd3624e2f3f1ac40ac Reviewed-by: Maurice Kalinowski Reviewed-by: Oliver Wolff --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/plugins/platforms/winrt') diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 2e38f81499..583441f396 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -1020,7 +1020,9 @@ HRESULT QWinRTScreen::onOrientationChanged(IInspectable *) HRESULT QWinRTScreen::onBackButtonPressed(IInspectable *, IBackPressedEventArgs *args) { QKeyEvent backPress(QEvent::KeyPress, Qt::Key_Back, Qt::NoModifier); + QKeyEvent backRelease(QEvent::KeyRelease, Qt::Key_Back, Qt::NoModifier); backPress.setAccepted(false); + backRelease.setAccepted(false); QObject *receiver = m_visibleWindows.isEmpty() ? static_cast(QGuiApplication::instance()) @@ -1028,12 +1030,8 @@ HRESULT QWinRTScreen::onBackButtonPressed(IInspectable *, IBackPressedEventArgs // If the event is ignored, the app will suspend QGuiApplication::sendEvent(receiver, &backPress); - if (backPress.isAccepted()) { - args->put_Handled(true); - // If the app accepts the event, send the release for symmetry - QKeyEvent backRelease(QEvent::KeyRelease, Qt::Key_Back, Qt::NoModifier); - QGuiApplication::sendEvent(receiver, &backRelease); - } + QGuiApplication::sendEvent(receiver, &backRelease); + args->put_Handled(backPress.isAccepted() || backRelease.isAccepted()); return S_OK; } -- cgit v1.2.3 From bbcdccd6768f999a49717dfc78efd4bb9d880412 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 16 Apr 2014 21:18:27 +0200 Subject: deprecate import_qpa_plugin and qpa_minimal_plugin they have been fully superseded by 4255ba40ab073afcf2a095b135883612859af4c2. Change-Id: If7ac14c8b7d3cf00fb0cb916036b62eb86c9cee0 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- src/plugins/platforms/winrt/winrt.pro | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/winrt') diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro index 60c87bb61a..0122bf9475 100644 --- a/src/plugins/platforms/winrt/winrt.pro +++ b/src/plugins/platforms/winrt/winrt.pro @@ -12,6 +12,7 @@ winphone { PLUGIN_TYPE = platforms PLUGIN_CLASS_NAME = QWinRTIntegrationPlugin +!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = - load(qt_plugin) QT += core-private gui-private platformsupport-private -- cgit v1.2.3