-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add basic Ubuntu Touch functions #12543
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
base: main
Are you sure you want to change the base?
Conversation
1b21648
to
cb156e6
Compare
* | ||
* \since This function is available since SDL 3.4.0. | ||
*/ | ||
extern SDL_DECLSPEC bool SDLCALL SDL_IsUbuntuTouch(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what conditions does the application need to know this is Ubuntu Touch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used internally by SDL to detect when to use certain tweaks for Ubuntu Touch, like the Wayland driver bug. Since Ubuntu Touch is just Linux, it doesn't expose any compiler macro like __UBUNTU_TOUCH__
that could help determine when to use these tweaks.
Since app developers may also want to tweak their apps on Ubuntu Touch, I considered it might help to expose that function in the API.
include/SDL3/SDL_system.h
Outdated
* | ||
* \sa SDL_UTFormFactor | ||
*/ | ||
extern SDL_DECLSPEC SDL_UTFormFactor SDLCALL SDL_GetUbuntuTouchFormFactor(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be considered as a more general function in the API. Can you please split this out as a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean I should replace this with something like SDL_GetFormFactor()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the code from this PR and I've made an initial implementation in #12584.
465ea30
to
44c7913
Compare
1951691
to
bd4b995
Compare
This adds support for: - System theme - Sandbox detection - Platform detection - Device form factor detection
Description
This adds support for:
Many things aren't properly supported yet, but changes and upgrades will happen on the Ubuntu Touch side, so SDL should automatically support more Ubuntu Touch features as time goes.
Existing Issue(s)
Works towards #12272