qt6-bb10/src
Tor Arne Vestbø 9271068f91 iOS: Pause display link when app moves out of active state
The applicationWillResignActive documentation describes that the app
should "use this method to pause ongoing tasks, disable timers, and
throttle down OpenGL ES frame rates". Similarly, the more modern
sceneWillResignActive describes that the app should "use this method
to quiet your interface and prepare it to stop interacting with the
user. Specifically, pause ongoing tasks, disable timers, and decrease
frame rates or stop updating your interface altogether."

In practice the application enters the inactive (as opposed to the
backgrounded) state when the user brings up the app switcher, or
enters split-view mode, as described by the "Adopting Multitasking
Enhancements on iPad" documentation.

We do propagate the inactive state as Qt::ApplicationInactive, but
it was up to the application itself to react to the state.

To adhere to the documented behavior, we now skip update request
delivery if the app is not active. Once it becomes active again
we re-try the update request delivery.

Relying on the exposed state of window was not an option, as the
window is still technically exposed, even if the app itself is
inactive.

This hopefully fixes a GPU crash observed (only) on A10 iPads
(iPad 7) with iOS 18, when the user entered split-view mode,
possibly due to changes in the system Metal-based OpenGL driver:

  void IOGPUScheduler::signalHardwareError(eRestartRequest, int32_t)
  void IOGPUScheduler::hardware_error_interrupt(IOInterruptEventSource *, int)
  void IOGPUCommandQueue::retireCommandBuffer(IOGPUEventFence *)
      Deny submissions/ignore app[openglwindow] with 2 GPURestarts in 31 submissions.
  Execution of the command buffer was aborted due to an error during execution
      Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout)
  GLDRendererMetal command buffer completion error
      Error Domain=MTLCommandBufferErrorDomain Code=2
  Execution of the command buffer was aborted due to an error during execution
      Ignored (for causing prior/excessive GPU errors)
  Terminating due to blacklisting by kernel driver

The back-trace always pointed to the display-link callback,
so the assumption is that the crash was triggered by the app
rendering when it shouldn't, during the split-view transition.

Fixes: QTBUG-132314
Pick-to: 6.5 5.15
Change-Id: Idf1f692daa9d437ee69f9436706777b220fbfbf4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c812190a921660c748be3324c3a34245b24354e9)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1b993a787d7e1e2ed7bde8102847424db676d2c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-14 08:39:35 +00:00
..
3rdparty SQLite: Update SQLite to v3.49.0 2025-02-08 13:53:39 +00:00
android Android: Fix cursorHandle and EditPopup positions 2025-02-10 21:26:32 +00:00
assets Tasktree: fix FTBFS due to unique_ptrs on forward-declared classes 2025-01-15 16:24:43 +00:00
concurrent Qt Concurrent documentation: fix Forward Iterator example container 2025-02-13 20:33:23 +00:00
corelib QUrl: avoid going up from the drive path on Windows file URLs 2025-02-12 07:54:55 -08:00
dbus CMake: Use the $<VERSION> placeholder in qt_attribution.json 2025-01-13 14:34:59 +01:00
entrypoint CMake: Correctly annotate the Entrypoint (winmain) SBOM license ID 2024-06-19 08:15:40 +00:00
gui QLayoutPolicy: use qCountTrailingZeroBits() in setControlType() 2025-02-13 20:33:25 +00:00
network QHttp2Connection: Fix handling of MAX_HEADER_TABLE_SIZE setting 2025-01-15 21:53:47 +00:00
opengl Doc: Fix method docs for QOpenGLTexture::setWrapMode 2025-01-25 14:21:29 +00:00
openglwidgets Remove GENERATE_CPP_EXPORTS argument 2024-06-13 14:39:17 +00:00
platformsupport libinput: Print qsizetype through %PRIdQSIZETYPE 2024-11-06 13:16:41 +00:00
plugins iOS: Pause display link when app moves out of active state 2025-02-14 08:39:35 +00:00
printsupport Docs: Add that Qt Print Support is not available on Android 2025-01-22 02:25:28 +00:00
sql QtSql: fix GCC -Wextra-semi warnings after member function definitions 2024-12-20 10:40:03 +00:00
testlib QTest: fix bug dereferencing nullptr in toString<std::nullptr_t>() 2025-02-05 21:13:47 +01:00
tools AndroidTestRunner: allow to call additional/extra adb call 2025-02-12 09:59:42 +01:00
widgets QToolButton: allow opening a menu after it first failed because empty 2025-02-12 20:26:40 +00:00
xml [QDomNodePrivate] delete unnecessary pointer check from the statement 2024-12-12 17:36:21 +00:00
CMakeLists.txt Add Qt icon library for examples 2023-04-22 18:14:38 +03:00