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

Build crashes if fullscreen & getSafeArea() is called. #277

Open
HugoAdams opened this issue Aug 11, 2024 · 5 comments
Open

Build crashes if fullscreen & getSafeArea() is called. #277

HugoAdams opened this issue Aug 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@HugoAdams
Copy link

If fullscreen is set to true, either through love.conf(), love.window.setFullscreen() or love.setMode() and then love.window.getSafeArea() is called then the application will crash.

function love.load()
    love.window.setFullscreen(true)
    print(love.window.getSafeArea())
end

If you run this code, logcat will show multiple errors.

The application will run fine if setFullscreen is called without calling getSafeArea and vice versa. It just means you cannot access the safe area while in fullscreen mode.

However, getSafeArea() can be called before setting fullscreen, but this does not work as the safe area returned has x and y set to 0, 0. If these were accurate numbers this method might be usable.

@MikuAuahDark
Copy link
Collaborator

May I know the LOVE version you're using on?

@HugoAdams
Copy link
Author

This was on 11.4, but it seems to effect 11.5 too.

@MikuAuahDark MikuAuahDark added the bug Something isn't working label Aug 11, 2024
@slime73
Copy link
Member

slime73 commented Aug 11, 2024

If you run this code, logcat will show multiple errors.

What are the errors (when running with 11.5)?

@HugoAdams
Copy link
Author

HugoAdams commented Aug 11, 2024

This is a logcat of the crash (github doesn't let me upload it directly). This is tested on a physical device (Samsung Galaxy Z Flip 3), the code I posted earlier seems to work ok on some virtual devices in Android Studio.

I think this is because devices in Android Studio do not simulate the safe area unless you use the developer option to Draw Cutout (it draws various notches and is off by default).
I just tried on a virtual device (Pixel 8 API 35) with that setting on and it crashed with what looks like the same errors.

logcats.zip

@MikuAuahDark
Copy link
Collaborator

Thanks for the log. I think I found the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants