summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosscreen.mm
Commit message (Collapse)AuthorAgeFilesLines
* Move screen maintenance functions from QPlatformIntegration to QWSITor Arne Vestbø2019-03-191-5/+5
| | | | | | | | | | | | | | | QWindowSystemInterface is the de facto API for any plumbing going from the platform plugin to QtGui. Having the functions as protected members of QPlatformIntegration was idiosyncratic, and resulted in awkward workarounds to be able to call the functions from outside of the QPlatformIntegration subclass. The functions in QPlatformIntegration have been left in, but deprecated so that platform plugins outside of qtbase have a chance to move over to the new QWSI API before they are removed. Change-Id: I327fec460db6b0faaf0ae2a151c20aa30dbe7182 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Remove codepaths and checks for unsupported Apple platformsTor Arne Vestbø2018-08-311-6/+1
| | | | | | | We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3. Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-021-13/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * iOS: Guard all uses of APIs not available in application extensionsTor Arne Vestbø2018-06-051-13/+20
| | | | | | | | | | Change-Id: Ic058a0c07f6cdd0a015f46db96fce1536a712711 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Provide QPlatformWindow::hasPendingUpdateRequest() helper functionTor Arne Vestbø2018-04-171-5/+4
| | | | | | | | | | | | | | So that platform plugins don't need to dive into QWindowPrivate. Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Move delivery of update requests into QPlatformWindowTor Arne Vestbø2018-03-291-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Having deliverUpdateRequest in QWindowPrivate was a bit awkward and asymmetric to the QPlatformWindow::requestUpdate() API. Keeping them together follows the existing pattern of plumbing things through the platform window, and also allows us to move away from platform plugins relying on QWindowPrivate implementation details. Change-Id: Ib131ccdd1c2bdd6ff1c8d95facbc3f6f88a1abcf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Clean up our Objective-C usageJake Petroules2018-02-201-8/+6
|/ | | | | | | | | | | | | | | | - Move ivars into @implementation - Use instancetype where applicable - Use dot notation for property access - Use subscript operator for dictionaries and arrays - Format selectors consistently - Use proper style for init methods - Use generics instead of void pointers where possible - Use "range for" loops instead of indexing - Replace or replace IBAction/IBOutlet with void Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-301-6/+65
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/win32-g++/qmake.conf src/corelib/global/qglobal_p.h src/corelib/global/qoperatingsystemversion_p.h src/corelib/io/qfilesystemengine_win.cpp src/network/bearer/qbearerengine.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qfusionstyle.cpp tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
| * iOS: Don't send all touch events asyncTor Arne Vestbø2017-12-221-1/+1
| | | | | | | | | | | | | | | | | | Commit 77942a1bdf9 introduced the QScopedValueRollback, but without assigning it to a local temporary, so the value was rolled back immediately, resulting in always sending touch events async. Change-Id: Ic7f65c3d38c46813ff06694e883dae3df138b9d4 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * iOS: Implement QIOSScreen::refreshRate to account for 120Hz displaysTor Arne Vestbø2017-12-111-0/+10
| | | | | | | | | | | | Task-number: QTBUG-64968 Change-Id: If96f6cde8f2fc6d91beb842d82a881fe057260b5 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * iOS: Try to detect and deal with delayed touch delivery due to gesturesTor Arne Vestbø2017-12-061-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A UIGestureRecognizer may have its delaysTouchesBegan or delaysTouchesEnded properties set, which causes iOS to not deliver touch events to the view until the recognizer has failed recognition of its gesture. In that case, the touch event is not delivered via [UIWindow sendEvent:] as usual, but via _UIGestureEnvironmentSortAndSendDelayedTouches. The latter function is apparently not reentrant, as opening a native alert dialog in response to the touch delivery will result in the dialogs's buttons to stop working, probably because they themselves use gestures. Unfortunately iOS maintains two internal gesture recognizers on iPad, of type _UISystemGestureGateGestureRecognizer, probably related to the swipe-from-bottom gesture used for multitasking. Without any workaround, these two recognizers will result in any tap on the bottom part of the screen to be delivered delayed, which may introduce stuck alert dialogs as described above. UITouch has a gestureRecognizers property, but unfortunately this property does not give us any information in the cases where we need it, so we have to use an heuristic involving a UIWindow subclass to detect the case where event delivery is delayed. As there is no way to prevent the user from recursing into an event loop when delivering the event, our only hope is to deliver the event asynchronously. Task-number: QTBUG-64577 Change-Id: I11d9caa8c4542dc80426a9e58ea555914bed433e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * iOS: Implement QPlatformScreen::name for easier debuggingTor Arne Vestbø2017-12-061-0/+10
| | | | | | | | | | Change-Id: I077bec93fe2086c38ebe986b322977a50a1ab27d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * iOS: Compute screen available geometry based on safe area insetsTor Arne Vestbø2017-11-301-5/+24
| | | | | | | | | | | | | | | | | | | | In addition to the (deprecated) applicationFrame property, we base the available geometry on the root view's safe area, which also takes into account system-reserved areas on iPhone X, and the screen's bezel in the case of tvOS. Change-Id: I252d960a0e486dd0c7e30843f88c0bf5684feb24 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-12-051-15/+21
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
| * iOS: Don't treat AppleTV as an iDevice when resolving physical DPITor Arne Vestbø2017-11-291-2/+2
| | | | | | | | | | Change-Id: I07ac92a7b2d8c65b7d70a4f2ed5f96f8f4d99ef0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * iOS: Update screen metrics (physical DPI) for the latest set of devicesTor Arne Vestbø2017-11-291-13/+19
| | | | | | | | | | | | | | We were missing some recent iPads, and the iPhone 8 Plus and X. Change-Id: Ib65644a277a1cbd75ccb360b79b9ac8af935c741 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Remove obsolete version checksJake Petroules2017-09-251-23/+9
|/ | | | | | | Our iOS deployment target is now 8, so this code will never be executed. Change-Id: I7dd4001c01d7c8c2e8e977753cb3fa246b19ce06 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Remove compatibility code paths for macOS < 10.10 and iOS < 8.0Jake Petroules2017-01-091-3/+4
| | | | | Change-Id: I11bec0efc2b4d86adf64a58990260fee70f050ac Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-021-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blacklist tst_QMenuBar::taskQTBUG46812_doNotLeaveMenubarHighlighted() on macOS. Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/sdk.prf src/angle/src/libEGL/libEGL.pro src/platformsupport/fontdatabases/fontdatabases.pro src/platformsupport/platformsupport.pro src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro tests/auto/widgets/widgets/qmenubar/BLACKLIST tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Task-number: QTBUG-56853 Change-Id: If58785210feee3550892fc7768cce90e75a2416c
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-011-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-171-2/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/macx-ios-clang/features/resolve_config.prf src/testlib/qtestcase.qdoc Change-Id: Icefa63056ffb37106f35299a8f19165535571799
| | | * iOS: Report correct physical DPI for iPhone 7 PlusTor Arne Vestbø2016-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-56509 Change-Id: Ibae94262c2a4c917aeca00cb1a1c28e5ae60f0c4 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-211-0/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qcoregraphics.mm src/network/access/qnetworkrequest.h src/plugins/platforms/cocoa/qcocoahelpers.mm Change-Id: I81266414c06ea2edf63cbc7e93a86bd5d66a31a5
| * | | Fix namespaced build on iOSJake Petroules2016-09-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I682fabe8891e0325e6545b4499a59af4ad584c41 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * | | iOS: Implement support for QScreen::grabWindow()Tor Arne Vestbø2016-09-181-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only windows that are part of the application can be grabbed. This excludes the system statusbar and other system overlays, as well as windows of other applications. This is a limitation due to the security model of iOS. There exists APIs to grab a snapshot of the complete screen, but these APIs return a view that can be used as a placeholder e.g. during view transformations, and doesn't match our API that require reading of pixels. Task-number: QTBUG-49944 Change-Id: I8fd5b4c2777be1486f0ff22762d5e9b64c927e70 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | | Replace usages of QSysInfo with QOperatingSystemVersionJake Petroules2016-09-201-3/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Occurrences which should simply be removed entirely (due to always being true or always being false as a result of the current OS support matrix) have been left untouched for now. Change-Id: I86d5a084cb84bc28fefc5191d40924de1439b3de Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/devLiang Qi2016-06-211-0/+58
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-211-0/+58
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qsysinfo.h src/corelib/kernel/qcoreapplication_win.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/plugins/platforms/windows/qwindowsglcontext.cpp src/plugins/platforms/windows/qwindowsglcontext.h Change-Id: Ib3500acc2b28553bde06758cd9a2e19eb7fe2978
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-201-0/+58
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And blacklisted a few tests in tst_QUdpSocket. Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtNative.java src/corelib/global/qglobal.cpp src/corelib/global/qsystemdetection.h src/corelib/io/qfileselector.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp tests/auto/network/socket/qudpsocket/BLACKLIST Task-number: QTBUG-54205 Change-Id: I11dd1c90186eb1b847d45be87a26041f61d89ef6
| | | * uikit: Deliver update requests via CADisplayLink callbackTor Arne Vestbø2016-06-171-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improves performance over the default timer-implementation, and allows us to control the rate and paused state of the display link. Change-Id: I05761b6eb48f5e91af35735e2faa477427cd8440 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | | Restore use of ifdef for TVOSMike Krus2016-06-201-2/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | UIScreen.applicationFrame is not defined at all on tvOS. Was broken by 88ebee5cd7fe2416775b12b25498ac86ac4d9af8 Change-Id: I692f464d538561961b40a6fbdcab51a3320e5779 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | uikit: Remove use of ifdef when resolving available screen geometryTor Arne Vestbø2016-06-141-5/+2
| | | | | | | | | | | | | | | | | | | | | More explicit that we're falling back to m_geometry on non-iOS platforms. Change-Id: I09bd5270aee5edb977983893a8407218eea0f74a Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | darwin: Add Foundation conversion functions for QRect/QRectFTor Arne Vestbø2016-06-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fromCGRect function was left out for QRect, as the foundation type is using CGFloats internally. Clients should use an explicit QRectF::toRect() when potentially throwing away precision. Change-Id: I0d4c5c5a4e6a45ea3287e3f37a00b69b0bfdefcf Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Add support for Apple tvOSMike Krus2016-05-171-1/+15
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass -xplatform macx-tvos-clang to configure to build. Builds device and simulator by default. Added ‘uikit’ platform with the common setup. Also added QT_PLATFORM_UIKIT define (undocumented). qmake config defines tvos (but not ios). tvOS is 64bits only (QT_ARCH is arm64) and requires bitcode to be embedded in the binary. A new ‘bitcode’ configuration was added. For ReleaseDevice builds (which get archived and push to the store), bitcode is actually embedded (-fembed-bitcode passed to clang). For all other configurations, only using bitcode markers to keep file size down (-fembed-bitcode-marker). Build disables Widgets in qtbase, and qtscript (unsupported, would require fixes to JavaScriptCore source code). Qpa same as on iOS but disables device orientation, status bar, clipboard, menus, dialogs which are not supported on tvOS. Change-Id: I645804fd933be0befddeeb43095a74d2c178b2ba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-6/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| * iOS: Report correct physicalSize and physicalDotsPerInch for iPhone6+Tor Arne Vestbø2016-05-021-6/+21
| | | | | | | | | | | | | | | | | | | | On iPhone 6(s) Plus devices, or when display zoom is enabled in an iPhone 6, the render buffer is scaled before being output on the physical display. We have to take this into account when computing the physical size. Task-number: QTBUG-50941 Change-Id: I318f3a866d039fccf0ba08f381fc9d8bcd676acd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* iOS: Update pixel density (PPI) logic to detect new iOS devicesTor Arne Vestbø2015-11-191-10/+15
| | | | | | | | | | | Since the iPhone 6(S) Plus devices have a PPI of 401, we change the logic from storing the unscaled PPI to storing the scaled PPI, and applying that to a scaled geometry when computing the physical size. Task-number: QTBUG-49467 Change-Id: I1741ff075749a301d2434cd35f642fcc9ea4b581 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Clean up style in Objective-C message signaturesTor Arne Vestbø2015-05-241-4/+4
| | | | | | | | | | - Space between class/instance signifier - No space between return type and message name - No space in message arguments Change-Id: Ie25e0be3c134586c44bb82bf7075f6eb153388a9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* iOS: Guard QIOSScreen against notifying Qt about changes to deleted QScreensTor Arne Vestbø2015-02-021-6/+14
| | | | | | | | | | | Now that we can rely on screen() returning 0 when the QScreen is not available we can return early from updateProperties(). We still compute the member variables as they may be accessed directly for the still alive QPlatformScreen. Change-Id: Ia7d0d29a6b50a9c932b565dc53b23d66331c275e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Limit auto-rotation to device screen (excludes external screens)Tor Arne Vestbø2015-01-241-20/+22
| | | | | | | | | | | An external screen should always stay in the native orientation of the screen, and not be affected by rotations of the device. If the user requires the external content to follow the device rotation, this can be done explicitly by listening to orientation changes of the main screen, or using QSensors. Change-Id: I3a98655d11915f0db107930e7d97a24417656bc9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Associate UIScreen and show UIWindow on initial QWindow mappingTor Arne Vestbø2015-01-231-6/+0
| | | | | | | | | | | | We delay showing the UIWindow until the first QWindow is created and mapped to the screen. This allows external screens to stay in mirror mode until a QWindow has been explicitly created on that screen. We also remove the screen-association when the last QWindow on that screen has been removed, which will return the external screen to mirror mode. Change-Id: Iccecb297281d0c4f397f69f2494debff051ade01 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Base [QIOSViewController shouldAutorotate] on the locked orientationTor Arne Vestbø2015-01-231-5/+4
| | | | | | | | | Instead of keeping a separate property for the auto-rotation. Allows us to override shouldAutorotate later on to make the decision even more fine grained. Change-Id: I9a3cd6c1316f2a5485a94ef8d9b633df87f46f5f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Decouple screen geometry calculations from UIWindow geometryTor Arne Vestbø2015-01-231-11/+20
| | | | | | | | | | | | | At startup or when a new UIWindow has been created but not associated with a UIScreen yet, its geometry will be invalid, and cause the wrong geometry for its corresponding QScreen when we use it to map geometry. Instead we explicitly use the status bar orientation to map to the correct geometry. Change-Id: If37b3ab2ad5db65e20a7e3af5c3854b3e3ddff0d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Only use [UIDevice orientation] for the main/device screenTor Arne Vestbø2015-01-231-0/+4
| | | | | | | | Auxiliary screens are always in their primaryOrientation. Change-Id: I078151ccbdb8a78eb095a05672f7804ab608ff24 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Make screen orientation reporting more consistentTor Arne Vestbø2015-01-221-11/+18
| | | | | Change-Id: Ic21efb939639711c4071161e3c742525a55d41be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Fall back to statusbar orientation for initial QScreen::orientation()Tor Arne Vestbø2015-01-211-3/+13
| | | | | | | | | | | | | | At startup, iOS will report UIDeviceOrientationUnknown for the device orientation, which toQtScreenOrientation() maps to portrait. We can be smarter than that, by falling back to the orientation of the statusbar, which in most cases match the physical orientation of the screen at startup, unless the Info.plist file has been modified to limit the possible orientations. See also: https://gist.github.com/torarnv/40c1931205e33d2b1ed3 Change-Id: I5c78fbe5c670ed2909a51b478bd4814e2433554f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Use QPlatformIntegration::destroyScreen() instead of manual deleteTor Arne Vestbø2015-01-211-1/+2
| | | | | Change-Id: I8128fa1a4b7d6d202d15c03d51f6360a74d75d8c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>