Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Semphriss
Copy link
Contributor

Description

This adds support for:

  • System theme
  • Sandbox detection
  • Device form factor detection

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

@Semphriss Semphriss force-pushed the ubuntu-touch branch 12 times, most recently from 1b21648 to cb156e6 Compare March 17, 2025 04:58
*
* \since This function is available since SDL 3.4.0.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_IsUbuntuTouch(void);
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

*
* \sa SDL_UTFormFactor
*/
extern SDL_DECLSPEC SDL_UTFormFactor SDLCALL SDL_GetUbuntuTouchFormFactor(void);
Copy link
Collaborator

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?

Copy link
Contributor Author

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()?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Contributor Author

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.

@slouken slouken added this to the 3.4.0 milestone Mar 17, 2025
@Semphriss Semphriss force-pushed the ubuntu-touch branch 6 times, most recently from 465ea30 to 44c7913 Compare March 19, 2025 17:13
@Semphriss Semphriss force-pushed the ubuntu-touch branch 2 times, most recently from 1951691 to bd4b995 Compare March 27, 2025 01:51
This adds support for:
- System theme
- Sandbox detection
- Platform detection
- Device form factor detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants