summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qioswindow.mm
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-201-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Don't reallocate renderbuffer on QIOSContext::swapBuffers()Tor Arne Vestbø2016-06-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During device rotation, the backing CEAGLLayer of our custom UIView is resized by the system. Normally this is the time where we would then reconfigure the corresponding renderbuffer that we render to, which shares memory with the CEAGLLayer, but we chose a lazy approach where we'd defer the reconfigure until client code actually called makeCurrent. This caused problems because not only did we implement the lazy reconfig in makeCurrent, but in every QIOSContext function that operated on the default FBO, including swapBuffers(). When using threaded rendering, such as in Qt Quick, the render thread may be half way in rendering a new frame when the system resizes the CEAGLLayer, and we pick up that resize on the swapBuffer call and allocate a new renderbuffer, before flushing the queued up GL commands that were operating on another renderbuffer of a different size. This resulted in the following crash: 0 - gpus_ReturnObjectErrorKillClient() 1 - gpusSubmitDataBuffers() 2 - glrFlushContextToken() 3 - flush(__GLIContextRec*)() 4 - QIOSContext::swapBuffers(QPlatformSurface*) ... We solve this by still being lazy in how we reconfigure, but limit the reconfigure to makeCurrent(). If the CEAGLLayer is resized in between two frames, we skip the half-drawn frame. The old frame will then be scaled to match the new size by the system, but this is preferable to flushing a new frame that may have been drawn with two conflicting window geometries. Task-number: QTBUG-50017 Change-Id: Ie229f26d156dfbfc7ed8d9efd0eb5e992eee73f1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * uikit: Deliver update requests via CADisplayLink callbackTor Arne Vestbø2016-06-171-0/+5
| | | | | | | | | | | | | | | | 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>
* | 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>
* Return format as specified in original QWindowMike Krus2015-06-261-0/+7
| | | | | | | | | | | | Overload QPlatformWindow::format() to return the desired format defined in the QWindow. This is required for windows that define specific surface formats (such as those used in Qt3d which require a depth buffer). This is similar to what is done in the OS X Cocoa QPA plugin. Change-Id: I7661a2a9c4e13603d03d3a5be10d000f73c712e6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* ios: don't autoactivate if _q_showWithoutActivatingRichard Moe Gustavsen2015-05-061-1/+2
| | | | | | | | | | | | | | | | Widgets can have the attribute Qt::WA_ShowWithoutActivating set, which is forwarded to QWindow as a property (_q_showWithoutActivating). Both The cocoa plugin and the windows plugin check for this property before activating a window upon setVisible, so lets do the same for the iOS plugin. Note that this is not the same as shouldAutoActivate, since the window should gain focus like normal if the user taps on it. Change-Id: Ie6c95d4044906d97f0a03d27009a23d462c6ca34 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* ios: don't accept first responder if Qt::WindowDoesNotAcceptFocusRichard Moe Gustavsen2015-05-061-0/+3
| | | | | Change-Id: I01801648a1971444e0727e1bf0790cb3a0d0aad5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Add Qt::WindowFlag to signal that maximizing should cover full screen geometryTor Arne Vestbø2015-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Normally when maximizing a window it will cover the available geometry of the screen, as represented by QScreen::availableGeometry(), which typically excludes status/menu bars and application launchers. On some platforms it may still be possible to place windows in the areas of the screen that are outside of the available geometry, but this will result in the window being partially covered by (possibly) transparent system UIs. The new flag allows the user to specify that when maximizing the window it should try to cover as much as possible of the screen geometry (in contrast to going full screen, which would typically hide any system UIs). For iOS this is a common use-case, as the status bar is transparent, and the user-interface guidelines for iOS7 and up recommend taking advantage of the full screen space, while keeping any user-interaction elements still inside the available geometry of the screen. Change-Id: I86d7fc937916d9cae245f7a3f9ae46abd92cdd29 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* iOS: Clarify implementation of QIOSWindow::isExposed()Tor Arne Vestbø2015-03-161-0/+19
| | | | | | | | | | | We treat windows as exposed even if the application state is still inactive (e.g. during startup), otherwise there's a visible moment of black screen between the launch screen fading out and the app rendering its first pixel. Change-Id: I48368459a8a46fa1c5b2853ea88adfe1ac61b6f7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Check if window was active on setVisible(false) through native APIsTor Arne Vestbø2015-03-161-1/+1
| | | | | | | | | | | | | When a QWindow is closed and destroyed it resets QGuiApp::focus_window before calling setVisible(false) on the platform window, so we don't have the needed information anymore to check if the window we are hiding was the focus-window. To work around this we use the native state instead, which should still be valid if the window was the focus window. Change-Id: I98057e6393411471f03668e3e5ce544f6b49c01d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.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: Simplify QIOSWindow::setParent()Tor Arne Vestbø2015-01-231-11/+4
| | | | | | Change-Id: I78c47c6ccdb53045f3fa412b1489e08691d3e195 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Fix QWindow::reportContentOrientationChange on iOS6+Tor Arne Vestbø2015-01-091-4/+15
| | | | | | | | | | | | | On iOS 6 and above, [UIViewController supportedInterfaceOrientations] needs to return 0 for [UIApplication setStatusBarOrientation] to work. This means once you report a content orientation other than the primary orientation, you'll disable auto-rotation. Reporting the orientation as Qt::PrimaryOrientation restores the auto-rotation behavior. Change-Id: I1b8c765c507728fdbc5b828e0b4215324014e221 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: only skip activating the most simple popup typesRichard Moe Gustavsen2014-11-261-3/+4
| | | | | | | | | | | | | | The current approach of not activating transient windows with the popup flag set was found to be too restrictive, as it would e.g stop transient dialogs from being able to contain editable controls. This patch will restrict the number of popup types that we skip activation for to only contain a few subtypes. Task-number: QTBUG-41613 Change-Id: I381a5a79fb4f7082da18a6b4e06a7255ff400b1a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Don't auto-activate popup windows unless they are standaloneTor Arne Vestbø2014-10-201-10/+25
| | | | | | | | | | | | We try to emulate a traditional window manager by activating windows on touch press (before delivering the event), and on showing/hiding windows, but this logic should not apply to popup windows (including tooltips and tool windows), as they are in most cases already active through their parent or transient parent, and should not steal keyboard focus and bring the virtual keyboard down. Change-Id: If10082bd48cdf1a9e1c41d8809066e86dafd7ffc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Remove unused and duplicated functions from QIOSWindowTor Arne Vestbø2014-10-201-1/+1
| | | | | | Change-Id: I29a2345bddc9ec9577bdc398e4df9914406e5367 QIOSWindow::windowType() is the same as window()->type() Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Move statusbar visibility handling to QIOSViewControllerTor Arne Vestbø2014-10-021-2/+1
| | | | | | | | | | | | | It doesn't belong in QIOScreen, and simplifies the flow when changing the focus window or the window state of the focus window. Both will result in calling updateProperties on the view-controller, which will re-configure the statusbar visibility and hide/show it as appropriate, before triggering a re-layout of its own view, which will in turn trigger an update of the screen properties based on the new statusbar state, before re-layouting of QWindow based on the new screen state. Change-Id: I89077a3fb5f843949ce833e4e727d2c753ea2eb6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Simplify QWindow/UIView geometry mappingTor Arne Vestbø2014-09-241-18/+1
| | | | | | | | | As we now have a root viewcontroller that always has a geometry that matches the containing UIWindow, we don't need to do any fancy calculations when mapping between the two. Change-Id: I08a7b9992be7b7238cbad2a2da20488bba1c0939 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Refactor text input handling to standalone responderTor Arne Vestbø2014-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of coupling the visibility of the virtual keyboard to the first-responder status of the currently active QUIView, we now treat first-responder as a separate state, tied directly to QWindow activation. This fits better with the concept of first-responders in iOS, as a UIView can become first-responder without dealing with text input, eg when dealing with touch events or menu actions. The decision point on whether or not to show the virtual keyboard is then handled by implementing the conformsToProtocol method and selectively returning YES for the UIKeyInput protocol. iOS internally calls _requiresKeyboardWhenFirstResponder on the UIResponder to determine this, but since we can't override a private method (like WKContentView in WebKit does) we have to rely on the fact that the implementation of the method uses the protocol conformance to make its decision. Once the virtual keyboard is up, we then need to react to changes to its configuration, such as keyboard type or the type of return key. Normally this would be a simple call to [view reloadInputViews], but iOS will not reload the built-in keyboards unless the UIResponder returns YES for _requiresKeyboardResetOnReload. Since we again can't override this private method (like WebKit does), we work around it by taking advantage of the fact that iOS will treat any change to the first-responder as a reason to do a keyboard reset. By using a stand-alone UIResponder for text input we can init and destroy these responders as needed, so that every call to reloadInputViews will trigger a reset, as the responder has not been seen before. We keep track of changes to the input-method-query, and detect whether or not we need to bring up a new UIResponder for text handling. As part of this refactoring we now tie the visibility of the virtual keyboard to the presence of a focus object that has input-methods enabled. This means that we automatically will track changes to input-elements through the focus changes, and reconfigure or hide the keyboard as appropriate. As a result the hide() method of QInputMethod becomes a no-op on iOS. Change-Id: I4c4834df490bc8b0bac32aeedbd819780bd5aaba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add support for QWindow::setOpacity()Tor Arne Vestbø2014-09-021-0/+6
| | | | | Change-Id: I027154aef35d219f08915e195f2baf8595ef7343 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Accessibility iOS: Fix crash after deleting a viewFrederik Gladhorn2014-08-261-0/+1
| | | | | Change-Id: I64e8357fcbf7f312308490351b7c692d31db5a43 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Refactor qioswindow.mm into quiview.mm and quiview_accessibility.mmTor Arne Vestbø2014-07-211-374/+6
| | | | | Change-Id: Ib6297e37d67b2c0ea251ae054b8ff877af2673a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Accessibility iOSFrederik Gladhorn2014-06-061-0/+73
| | | | | | | | | | | | | | | | | | | | | This lays the foundation for iOS accessibility. The approach is slightly different from other a11y bridges in that we completely flaten the hierarchy of wigets/quick items to a list. This works well with VoiceOver since there are comparatively few elements. The cache implementation for OS X is re-used. With this patch VoiceOver on iOS works on many applications out of the box. For now it sends the screen changed notfification somewhat overzealous, that will need revisiting and potentially new API in QAccessible. Device orientation changes are not yet supported. [ChangeLog][iOS] Accessibility was added to the iOS platform port. This enables Qt applications to be read by VoiceOver on iOS devices. Task-number: QTBUG-39097 Change-Id: I441e844652d528cc2fdcc444f43b54ed6fa04f0c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Gracefully handle cancelling of subset of active touchesTor Arne Vestbø2014-05-081-11/+25
| | | | | | | | | | | | | | | | | | | | | | | When applying the five-finger pinch gesture, we get a touchesCancelled callback with all five touch points, but the pinch gesture ends when the second to last finger is released from the screen. The last finger will not emit any more touch events, _but_, will contribute to starting another pinch gesture. That second pinch gesture will _not_ trigger a touchesCancelled event when starting, but as each finger is released, and we may get touchesMoved events for the remaining fingers. The event property 'allTouches' contains one less touch point than it should, so this behavior is likely a bug in the iOS system gesture recognizer, but have to take it into account when maintaining the Qt touch state. We do this by assuming that there are no cases where a sub-set of the active touch events are intentionally cancelled, and always clear the list of active touches. Task-number: QTBUG-37304 Change-Id: Icee79978508ecbc6854c0fb55d2da48b99d92f96 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Send updated expose events on application background/foregroundingTor Arne Vestbø2014-04-281-5/+27
| | | | | | | | | | | | | | | | When an application has background processing enabled, for example for communicating with an external accessory or getting location updates, it might trigger code that does UI updates, which will kill the app as doing UI in the background is not allowed on iOS. We guard against this by propagating the backgrounding as updated expose events with a non-exposed region and isExposed() returning false. This means clients who correctly use QWindow::isExposed() to guard their drawing code (including the scene-graph), will live to see another day. Task-number: QTBUG-36956 Change-Id: Ib708394d33093affe68c9f2c7abde7e54be5ec74 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: only activate top-level windowsRichard Moe Gustavsen2014-02-141-9/+12
| | | | | | | | | | | | | | | From before we would activate all QWindows that the user tapped on, or setVisible were called on. This is wrong since a QWindow does not have to be a top-level window. For a non-alien widget application this would mean that we would send activation events for all widgets that the user tapped on all the time. With this patch we do some extra checking before we tell a QWindow to activate. Change-Id: I1afe97e5384c36c67fee0bbd070d880bba7528a1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: activate window on touchesBeganRichard Moe Gustavsen2014-02-141-8/+3
| | | | | | | | | | | | | | We need to activate a window on touchesBegan instead of touchesEnded. The reason we used to do this on touchesEnded was to delay activating a window in case the user started e.g a flick. But delaying the activation can cause problems if the app activates a different window on press. We will then cancel this out on release since we then raise the pressed window instead. This is e.g typical when opening popups, and will cause focus to not be restored properly when later closing the popup again. Change-Id: I709b2f2e2633c9dc85c2761b0b176cd23c2f6b36 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: implement support for input methodsRichard Moe Gustavsen2014-02-061-0/+1
| | | | | | | | This change will add support for input methods, word completion, spell checking and related functionality. Change-Id: I41d4de1cab521c679d414cfc7c1a2d0f9c1fcaaf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: move key/text input into separate categoryRichard Moe Gustavsen2014-02-061-103/+11
| | | | | Change-Id: I62c588226b307d51f7f88b1cc0c1e00c0d0f14c6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: move QUIView interface decl into separate header fileRichard Moe Gustavsen2014-02-061-25/+1
| | | | | Change-Id: Idc90d85859229d49b1deecc2472b330f0adb1ef8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Add QWindowPrivate::topLevelWindow() helper functionTor Arne Vestbø2014-01-301-17/+0
| | | | | | | | Might be useful to expose to QWindow in 5.3, but for now it's private so it can be used by platform plugins. Change-Id: Iad96d7e249a7b85695668f8d7e8918164ec67442 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* iOS: Fix failing assert in QUIView displayLayer()Tor Arne Vestbø2013-12-111-3/+4
| | | | | | | | | | | | | In layoutSubviews we take the root viewcontroller position into account when determening the new QWindow geometry, but we were missing this logic in displayLayer, and would assert if the in-call statusbar was visible. Since we don't really need the position of the window in displayLayer, we change the assert to only check the size of the exposed area, which is independent of the position of the root viewcontroller. Change-Id: I774b8d9b075518e729f488a789b3a9e584c3f4d3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-051-13/+11
|\ | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-ios-clang/features/default_post.prf tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp Change-Id: Iaba97eed2272bccf54289640b8197d40e22f7bf5
| * iOS: Handle statusbar changes to child windowsTor Arne Vestbø2013-12-041-2/+2
| | | | | | | | | | | | | | | | | | Going through the platform window failed when the parent wasn't created yet. We can still get the window state of an yet-to-be-created top level window. Change-Id: Iaa61ddc50df037ac0bd2fd0884884c2bfce1dd9a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * iOS: fix assert when using QOffscreenSurfaceRichard Moe Gustavsen2013-12-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt defaults to creating a QWindow as offscreen surface if QPlatformIntegration::createPlatformOffscreenSurface returns 0. Using an offscreen surface is often done in a background thread, which is problematic, since then a QIOSWindow will also be created in a background thread. According to Apple docs, working with a UIView from other threads than the main thread should not be done. In our case, we instead hit an assert in QApplication that checks for the same. As a quick fix for Qt 5.2, we remove the offending call that causes the assert, since we anyway will call the same function lazily when becoming first responder. Task-number: QTBUG-35378 Change-Id: Id35462f99783a9748c688b163f6497de9bfff73e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * iOS: fix crash when application quitsRichard Moe Gustavsen2013-12-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An application will sometimes crash if the keyboard is told to hide while the application is about to quit. This patch will ensure that we set m_qioswindow (and [UIView qwindow]) to 0 when the window is destroyed. We also check this pointer before telling QUIView to resign first responder when closing the keyboard. The latter will fix the crash. Task-number: QTBUG-35356 Change-Id: I934088beb7e877c5b33d96225cb215a8ffd4dbb2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * iOS: fix application hangs when opening keyboardRichard Moe Gustavsen2013-12-031-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QIOSInputContext controls QUIViews first responder status based on whether or not the keyboard should be open. But since QGuiApplication updates focusObject before focusWindow (when e.g a popup closes), we sometimes ended up activating the old window upon a call to becomeFirstResponder. This in turn led the application to hang because of recursive dependencies in qioscontext when the focus window changed. So the solution for now is to avoid activating the window when the view becomes first responder. This should be fine since we now activate the window from QIOSWindow::requestActivateWindow (ref: 6272a816d1) Task-number: QTBUG-35340 Change-Id: I3068c14fec18d84d4b0b348a043c4c054e366c75 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | iOS: Apply default geometry to platform window if not set on QWindowTor Arne Vestbø2013-12-051-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a platform window is created from a QWindow without setting a valid size or position on the QWindow, the platform window is expected to apply sane defaults. We use the baseclass initialGeometry() function for this, similar to other platform plugins. The default geometry unless otherwise set and/or calculated based on size hints is that of the screen's available geometry. An improvement to this is to detect whenever we apply the screen geometry, and also apply the appropriate window state, but that needs more testing. Change-Id: I02b12064ce6d55c04fe0cc2cd1d2816ca1113f40 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | iOS: Don't claim that windows with zero width and/or height are exposedTor Arne Vestbø2013-12-051-0/+5
|/ | | | | | | | | | | When sending expose events to Qt, Qt will ask us if we're exposed, and we need to tell it that we're not, so that clients will not try to makeCurrent on a CA layer that has a zero width and/or height. Note that this only works because we flush expose events. Change-Id: Idfbe03a2f35681084061376a3c650a8da027fda4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Update statusbar visibility and screen properties before window geometryTor Arne Vestbø2013-11-251-8/+8
| | | | | | | | | | | | When setting a new window state. Otherwise we set the geometry based on the old screen properties, and then rely on the properties causing another window layout, which may not always happen. We also need to explicitly update the screen properties when the statusbar changes visibility, as there are no callbacks from iOS that consistently gives us that information. Change-Id: I1c3328aa3f34d294bc7db8884e611d205fd2c761 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: close keyboard upon hitting key 'done'Richard Moe Gustavsen2013-11-251-1/+4
| | | | | Change-Id: I0098cc4d51ca600ba48baa15ed9c16e56529b947 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: add [QUIView updateTextInputTraits]Richard Moe Gustavsen2013-11-251-9/+43
| | | | | | | | | | Configure QUIView text input traits from IM hints returned by the focus object when the view becomes first responder. This will affect the layout of the virtual keyboard. Change-Id: Ib140ba69d01cc747f3ac3cdd70dd2e7daede26b0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: don't loose precision when converting CG typesRichard Moe Gustavsen2013-11-251-4/+4
| | | | | | | | | CGRect and CGPoint consist of CGFloat variables. So we should convert to QRectF and QPointF rather than QRect and QPoint. Change-Id: I76f180e4064f54d5810c49b88fdbbcd914bdb686 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: scroll screen when keyboard opensRichard Moe Gustavsen2013-11-251-7/+14
| | | | | | | | | This change will let QIOSInputContext scroll the root view when the virtual keyboard is open, so that the input cursor is not obscured. Change-Id: If0758f4bf04c2b8e554e0196451154def7e3cb86 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: decouple QIOSWindow and QIOSInputContextRichard Moe Gustavsen2013-11-241-2/+0
| | | | | Change-Id: I85dda6fc0c6d2d11709b8bcdc0de6c0cef42d40f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* iOS: Re-enable kEAGLDrawablePropertyRetainedBackingTor Arne Vestbø2013-11-221-1/+1
| | | | | | | | | | Having it disabled caused issues with our backing-store implementation, which assumes that the backing store is retained, but for us is backed by a GL context. Change-Id: I18d05e226c7cf949adcd3b71801ffd845fa6d83d Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Deliver resize events synchronously after setGeometry for QtWidgetsTor Arne Vestbø2013-11-221-0/+3
| | | | | | | | | | | | | | | | | QWidget::show_sys() assumes synchronous geometry behavior by trying to resize both the platform window and the backing store if the widget's view of what the geometry is doesn't match the platform window's. The problem with that is that it's the widget which is not up to date, not the window, as the widget is not waiting for resize events before applying any resize logic. Instead of trying to fix widgets, we throw our hands in the air and give QtWidgets the synchronous behavior it assumes from the platform. Change-Id: I1b9241b9b13df661dc7f41c4cb8ecd02f5572256 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Change show() to imply maximize, and showFullScreen() to hide status barTor Arne Vestbø2013-11-221-4/+29
| | | | | | | | | | | | Matches the Android behavior, and gives an easy and predictable way to show true fullscreen windows that is similar to how one would do it on a desktop platform. We keep the statusbar visibility in sync with the window state of the active window. Change-Id: Ia4b99e03f83e19f9ef56cc99b9d477cc6da4c734 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Take position of root viewcontroller into account for geometry changesTor Arne Vestbø2013-11-221-4/+26
| | | | | | | | | | | | When setting the geometry on our UIView, or when reporting it back to Qt in our layoutSubviews callback, we need to take into account that the root viewcontroller may be not be positioned at 0,0 in the screen's window. Even when using the wantsFullScreenLayout property of the view controller this may be the case on iOS7 when the in-call status-bar is visible. Change-Id: I0ca706c1c9aff8ba4f3b4ccdf83dba713bd5c9c2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>