Surface Duo Reports Wrong Value For GetWindowVisibleDisplayFrame

Nathan Sokalski 4,111 Reputation points
2022-01-20T20:20:30.173+00:00

I have an app in which I need to know the height of the visible usable area. To do this, I use the following code:

Rect visiblebounds = new Rect();  
this.dlRoot.GetWindowVisibleDisplayFrame(visiblebounds);  

I debugged my app on the following:

Emulator in Visual Studio (API 29)
Samsung Galaxy S10e (API 30)
Surface Duo Emulator (API 29)
Surface Duo (API 29)

Here are screenshots from the first three of these (the physical Surface Duo did the same as the emulator, so I did not bother with a screenshot from that, I also cropped off the second screen from the Surface Duo Emulator screenshot since the app is only running on one screen):

166941-screenshot-1642706054.png

166942-screenshot-20220120-142151-golf-scorekeeper-experi.jpg

166925-screenshot-1642705821.png

Notice that the Emulator in Visual Studio & Samsung Galaxy S10e have API 29 & API 30, so this shows that the problem is not the API. Why is the Surface Duo giving an incorrect value for GetWindowVisibleDisplayFrame?

Developer technologies | .NET | Xamarin
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.