Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: love.window.getSafeArea(): returns same dimensions on a display with cutouts #2081

Closed
hhhapz opened this issue Jun 22, 2024 · 4 comments
Labels

Comments

@hhhapz
Copy link

hhhapz commented Jun 22, 2024

Hey, I'm running love2d in fullscreen mode on a Google Pixel 6a (Android) device which has a pinhole camera at the top of the screen.

I'm using the default template available at https://github.com/love2d/love-android as my base, so perhaps I can modify it there if this is an upstream SDL issue.

Here's the code I'm using to test:

Fullscreen.w, Fullscreen.h = love.graphics.getDimensions()
local x, y, w, h = love.window.getSafeArea()

print('reg', 0, 0, Fullscreen.w, Fullscreen.h)
print('safe' x, y, w, h)
I SDL/APP : [LOVE] reg	0	0	375	834
I SDL/APP : [LOVE] safe	0	0	375	834
@slime73
Copy link
Member

slime73 commented Jun 22, 2024

Do the reported dimensions or safe area ever change during your app's lifetime?

@hhhapz
Copy link
Author

hhhapz commented Jun 22, 2024

Added them to my update loop, seems not, sadly:
image

I will try allowing display orientation changes and see how that interacts

edit: nope, w and h just swap values :(

@MikuAuahDark
Copy link
Contributor

MikuAuahDark commented Jun 23, 2024

Is the notification bar visible (not running fullscreen)? If so then the OS will handle the cutouts. Otherwise, try debugging around this function.

https://github.com/love2d/love-android/blob/b09380d98bc6522bff309d6a580b34d1f58e65ba/app/src/main/java/org/love2d/android/GameActivity.java#L247

@hhhapz
Copy link
Author

hhhapz commented Jun 23, 2024

I'm using full screen/immersive mode. I'll investigate this and see what I find :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants