Skip to content

Commit fcd1182

Browse files
voki-andreev-aslouken
authored andcommitted
iOS: fix SDL_GetUIKitDeviceFormFactor return type
The function returns SDL_FormFactor values but was declared as bool, so iOS devices were misclassified (e.g. tablets as desktop).
1 parent 8dc1772 commit fcd1182

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/SDL.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ SDL_FormFactor SDL_GetDeviceFormFactor(void)
874874
#elif defined(SDL_PLATFORM_ANDROID)
875875
return SDL_GetAndroidDeviceFormFactor();
876876
#elif defined(SDL_PLATFORM_IOS)
877-
extern bool SDL_GetUIKitDeviceFormFactor(void);
877+
extern SDL_FormFactor SDL_GetUIKitDeviceFormFactor(void);
878878
return SDL_GetUIKitDeviceFormFactor();
879879
#elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) || defined(SDL_PLATFORM_PS2)
880880
return SDL_FORMFACTOR_CONSOLE;

src/video/uikit/SDL_uikitvideo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ void SDL_NSLog(const char *prefix, const char *text)
385385
* subsystem, but we need to stuff this into an Objective-C source code file.
386386
*/
387387

388-
bool SDL_GetUIKitDeviceFormFactor(void)
388+
SDL_FormFactor SDL_GetUIKitDeviceFormFactor(void)
389389
{
390390
// TODO: Apple Watch
391391
switch ([UIDevice currentDevice].userInterfaceIdiom) {

0 commit comments

Comments
 (0)