File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
src/Uno.UI/UI/Xaml/Window/Native Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ internal void RaiseNativeSizeChanged()
103
103
Rect windowBounds ;
104
104
Rect visibleBounds ;
105
105
106
+ var decorView = activity . Window . DecorView ;
107
+ var fitsSystemWindows = decorView . FitsSystemWindows ;
108
+
106
109
if ( ( int ) Android . OS . Build . VERSION . SdkInt < 35 )
107
110
{
108
111
var opaqueInsetsTypes = insetsTypes ;
@@ -134,9 +137,19 @@ internal void RaiseNativeSizeChanged()
134
137
this . Log ( ) . LogDebug ( $ "Insets: { insets } ") ;
135
138
}
136
139
137
- // Edge-to-edge is default on Android 15 and above
138
- windowBounds = new Rect ( default , GetWindowSize ( ) ) ;
139
- visibleBounds = windowBounds . DeflateBy ( insets ) ;
140
+ if ( fitsSystemWindows )
141
+ {
142
+ // The window bounds are the same as the display size, as the system insets are already taken into account by the layout
143
+ windowBounds = new Rect ( default , GetWindowSize ( ) . Subtract ( insets ) ) ;
144
+ visibleBounds = windowBounds ;
145
+ }
146
+ else
147
+ {
148
+ // Edge-to-edge is default on Android 15 and above
149
+ windowBounds = new Rect ( default , GetWindowSize ( ) ) ;
150
+ visibleBounds = windowBounds . DeflateBy ( insets ) ;
151
+ }
152
+
140
153
}
141
154
142
155
if ( this . Log ( ) . IsEnabled ( LogLevel . Debug ) )
You can’t perform that action at this time.
0 commit comments