diff options
| author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2025-08-29 23:30:54 +0300 |
|---|---|---|
| committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2025-09-06 01:27:38 +0300 |
| commit | 357580c2253b2e1e5c09170a249cc59b2da30677 (patch) | |
| tree | 35f3379b4305e5becb652b344eca7739273834a2 /src/plugins/platforms/android/qandroidplatformwindow.cpp | |
| parent | 8a969b400ed9574e108a07dc21aab00417868b75 (diff) | |
Android: hook into pre draw and attach listener to deliver safe area
Instead of relying only on setOnApplyWindowInsetsListener() and
trying to guess when to try and deliver root decor insets in case
the setOnApplyWindowInsetsListener() doesn't deliver the view's
insets early on, a cleaner way is to hook into
addOnAttachStateChangeListener() and OnPreDrawListener() listeners.
With this approach we guarantee that at least in one of those
cases, especially OnPreDrawListener(), we would be guaranteed
to get the insets when the view is attached. With this approach
we only need to get once such event and from there forward
we rely still on setOnApplyWindowInsetsListener().
Fixes: QTBUG-135808
Pick-to: 6.9 6.10
Change-Id: I05bf3009eb9a33f104d01d29e7f02d780900fc66
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformwindow.cpp')
| -rw-r--r-- | src/plugins/platforms/android/qandroidplatformwindow.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.cpp b/src/plugins/platforms/android/qandroidplatformwindow.cpp index c91c411dea8..1989ecdee3c 100644 --- a/src/plugins/platforms/android/qandroidplatformwindow.cpp +++ b/src/plugins/platforms/android/qandroidplatformwindow.cpp @@ -97,11 +97,6 @@ void QAndroidPlatformWindow::initialize() } qCDebug(lcQpaWindow) << "Window" << m_nativeViewId << "using surface container type" << static_cast<int>(m_surfaceContainerType); - - const bool isSameWindowAndScreenSize = geometry().size() == screen()->geometry().size(); - m_nativeQtWindow.callMethod("registerSafeAreaMarginsListner", - window->isTopLevel(), isSameWindowAndScreenSize); - } QAndroidPlatformWindow::~QAndroidPlatformWindow() |
