diff options
| author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2025-07-13 03:36:10 +0300 |
|---|---|---|
| committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2025-07-28 16:50:51 +0000 |
| commit | 0f3a6349f63786561a0bfe37e31351b73b6284ed (patch) | |
| tree | 517e9251b36aa841e745d886a936fb5bcc4dc400 /src/widgets/kernel/qwidget.cpp | |
| parent | 423eb26ef3d20aea96a5034dd1c07d00ccc02b96 (diff) | |
Widgets: use safe margins from QWindow::safeAreaMargins()
We don't need to go through the platform window and handle native
pixels conversion because QWindow::safeAreaMargins() already does that.
Pick-to: 6.10 6.9
Fixes: QTBUG-138157
Change-Id: I11ec493d1b3a55628a27632fa94b3d14e3f30a50
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
| -rw-r--r-- | src/widgets/kernel/qwidget.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index e3a5821406a..309ee9fb7e9 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7756,11 +7756,7 @@ QMargins QWidgetPrivate::safeAreaMargins() const if (!nativeWidget->windowHandle()) return QMargins(); - QPlatformWindow *platformWindow = nativeWidget->windowHandle()->handle(); - if (!platformWindow) - return QMargins(); - - QMargins safeAreaMargins = platformWindow->safeAreaMargins(); + QMargins safeAreaMargins = nativeWidget->windowHandle()->safeAreaMargins(); if (!q->isWindow()) { // In theory the native parent widget already has a contents rect reflecting |
