summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosscreen.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qiosscreen.mm')
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index b73f9c3cbc..c1613c1af4 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -83,9 +83,18 @@
- (void) orientationChanged:(NSNotification *)notification
{
Q_UNUSED(notification);
- Qt::ScreenOrientation orientation = toQtScreenOrientation([UIDevice currentDevice].orientation);
- if (orientation != -1)
- QWindowSystemInterface::handleScreenOrientationChange(m_screen->screen(), orientation);
+
+ UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
+ switch (deviceOrientation) {
+ case UIDeviceOrientationFaceUp:
+ case UIDeviceOrientationFaceDown:
+ // We ignore these events, as iOS will send events with the 'regular'
+ // orientations alongside these two orientations.
+ return;
+ default:
+ Qt::ScreenOrientation screenOrientation = toQtScreenOrientation(deviceOrientation);
+ QWindowSystemInterface::handleScreenOrientationChange(m_screen->screen(), screenOrientation);
+ }
}
@end