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.
Under what conditions does the application need to know this is Ubuntu Touch?
There was a problem hiding this comment.
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.
| * | ||
| * \sa SDL_UTFormFactor | ||
| */ | ||
| extern SDL_DECLSPEC SDL_UTFormFactor SDLCALL SDL_GetUbuntuTouchFormFactor(void); |
There was a problem hiding this comment.
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.
Do you mean I should replace this with something like SDL_GetFormFactor()?
There was a problem hiding this comment.
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
94c263e to
de9ce9e
Compare
514f3e7 to
13537b8
Compare
f7ef97b to
4a1cff1
Compare
This adds support for: - System theme - Sandbox detection - Platform detection - Writable directory (SDL_GetPrefPath)
|
|
||
| static char **SDL_ubuntu_touch_get_app_info(void) | ||
| { | ||
| static char appname[257] = ""; |
There was a problem hiding this comment.
We shouldn't add almost 1K of static data here. Instead this should be dynamically allocated if necessary and cleaned up in SDL_Quit()
| * \sa SDL_GetUbuntuTouchAppHook | ||
| * \sa SDL_GetUbuntuTouchAppVersion | ||
| */ | ||
| extern SDL_DECLSPEC const char *SDLCALL SDL_GetUbuntuTouchAppID(void); |
There was a problem hiding this comment.
Rather than adding API entries for these 3, instead let's make them global properties, like SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER and the app metadata?
There was a problem hiding this comment.
Is there a place where it would be best to initialize the new global properties?
I looked into creating them from SDL_Init(), but the code there expects the metadata to be already set, so an app calling SDL_Init wouldn't have the time to grab the information before calling SDL_SetAppMetadata.
Another option would be to automatically fill the app metadata values with the relevant options within SDL_Init before doing anything else, but this would contradict the documentation for SDL_SetAppMetadataProperty that says the properties have no default value, at least on Ubuntu Touch.
What would be the best to do?
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