diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 3b4cbd7d3..dd2fee730 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3586,3 +3586,13 @@ typedef SDL_JoystickGUID, SDL_GUID; - SDL_GUIDFromString + SDL_StringToGUID (...) +@@ +@@ +- SDL_OnApplicationWillResignActive ++ SDL_OnApplicationWillEnterBackground + (...) +@@ +@@ +- SDL_OnApplicationDidBecomeActive ++ SDL_OnApplicationDidEnterForeground + (...) diff --git a/docs/README-migration.md b/docs/README-migration.md index d43fc2309..77132c6bf 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1799,6 +1799,8 @@ The following functions have been renamed: * SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue() * SDL_LinuxSetThreadPriority() => SDL_SetLinuxThreadPriority() * SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy() +* SDL_OnApplicationDidBecomeActive() => SDL_OnApplicationDidEnterForeground() +* SDL_OnApplicationWillResignActive() => SDL_OnApplicationWillEnterBackground() * SDL_WinRTGetDeviceFamily() => SDL_GetWinRTDeviceFamily() * SDL_GetWinRTFSPathUTF8() => SDL_GetWinRTFSPath() * SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback() diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 88642d056..f1b31adeb 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -618,6 +618,8 @@ #define SDL_GDKGetTaskQueue SDL_GetGDKTaskQueue #define SDL_LinuxSetThreadPriority SDL_SetLinuxThreadPriority #define SDL_LinuxSetThreadPriorityAndPolicy SDL_SetLinuxThreadPriorityAndPolicy +#define SDL_OnApplicationDidBecomeActive SDL_OnApplicationDidEnterForeground +#define SDL_OnApplicationWillResignActive SDL_OnApplicationWillEnterBackground #define SDL_WinRTGetDeviceFamily SDL_GetWinRTDeviceFamily #define SDL_GetWinRTFSPathUTF8 SDL_GetWinRTFSPath #define SDL_iOSSetAnimationCallback SDL_SetiOSAnimationCallback @@ -1237,6 +1239,8 @@ #define SDL_GDKGetTaskQueue SDL_GDKGetTaskQueue_renamed_SDL_GetGDKTaskQueue #define SDL_LinuxSetThreadPriority SDL_LinuxSetThreadPriority_renamed_SDL_SetLinuxThreadPriority #define SDL_LinuxSetThreadPriorityAndPolicy SDL_LinuxSetThreadPriorityAndPolicy_renamed_SDL_SetLinuxThreadPriorityAndPolicy +#define SDL_OnApplicationDidBecomeActive SDL_OnApplicationDidBecomeActive_renamed_SDL_OnApplicationDidEnterForeground +#define SDL_OnApplicationWillResignActive SDL_OnApplicationWillResignActive_renamed_SDL_OnApplicationWillEnterBackground #define SDL_WinRTGetDeviceFamily SDL_WinRTGetDeviceFamily_renamed_SDL_GetWinRTDeviceFamily #define SDL_GetWinRTFSPathUTF8 SDL_GetWinRTFSPathUTF8_renamed_SDL_GetWinRTFSPath #define SDL_iOSSetAnimationCallback SDL_iOSSetAnimationCallback_renamed_SDL_SetiOSAnimationCallback diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 489101929..70d467253 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -716,7 +716,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void); +extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillEnterBackground(void); /** * Let iOS apps with external event handling report @@ -767,7 +767,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void); +extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidEnterForeground(void); #ifdef SDL_PLATFORM_IOS diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 2f3013f3b..44487f783 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -582,12 +582,12 @@ SDL3_0.0.0 { SDL_Metal_GetLayer; SDL_MinimizeWindow; SDL_MixAudio; - SDL_OnApplicationDidBecomeActive; + SDL_OnApplicationDidEnterForeground; SDL_OnApplicationDidChangeStatusBarOrientation; SDL_OnApplicationDidEnterBackground; SDL_OnApplicationDidReceiveMemoryWarning; SDL_OnApplicationWillEnterForeground; - SDL_OnApplicationWillResignActive; + SDL_OnApplicationWillEnterBackground; SDL_OnApplicationWillTerminate; SDL_OpenAudioDevice; SDL_OpenAudioDeviceStream; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 7318561b3..7e7a42f91 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -607,12 +607,12 @@ #define SDL_Metal_GetLayer SDL_Metal_GetLayer_REAL #define SDL_MinimizeWindow SDL_MinimizeWindow_REAL #define SDL_MixAudio SDL_MixAudio_REAL -#define SDL_OnApplicationDidBecomeActive SDL_OnApplicationDidBecomeActive_REAL +#define SDL_OnApplicationDidEnterForeground SDL_OnApplicationDidEnterForeground_REAL #define SDL_OnApplicationDidChangeStatusBarOrientation SDL_OnApplicationDidChangeStatusBarOrientation_REAL #define SDL_OnApplicationDidEnterBackground SDL_OnApplicationDidEnterBackground_REAL #define SDL_OnApplicationDidReceiveMemoryWarning SDL_OnApplicationDidReceiveMemoryWarning_REAL #define SDL_OnApplicationWillEnterForeground SDL_OnApplicationWillEnterForeground_REAL -#define SDL_OnApplicationWillResignActive SDL_OnApplicationWillResignActive_REAL +#define SDL_OnApplicationWillEnterBackground SDL_OnApplicationWillEnterBackground_REAL #define SDL_OnApplicationWillTerminate SDL_OnApplicationWillTerminate_REAL #define SDL_OpenAudioDevice SDL_OpenAudioDevice_REAL #define SDL_OpenAudioDeviceStream SDL_OpenAudioDeviceStream_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 75d40beac..0d3049496 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -618,12 +618,12 @@ SDL_DYNAPI_PROC(void,SDL_Metal_DestroyView,(SDL_MetalView a),(a),) SDL_DYNAPI_PROC(void*,SDL_Metal_GetLayer,(SDL_MetalView a),(a),return) SDL_DYNAPI_PROC(int,SDL_MinimizeWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_MixAudio,(Uint8 *a, const Uint8 *b, SDL_AudioFormat c, Uint32 d, float e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(void,SDL_OnApplicationDidBecomeActive,(void),(),) +SDL_DYNAPI_PROC(void,SDL_OnApplicationDidEnterForeground,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationDidChangeStatusBarOrientation,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationDidEnterBackground,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationDidReceiveMemoryWarning,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationWillEnterForeground,(void),(),) -SDL_DYNAPI_PROC(void,SDL_OnApplicationWillResignActive,(void),(),) +SDL_DYNAPI_PROC(void,SDL_OnApplicationWillEnterBackground,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationWillTerminate,(void),(),) SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_OpenAudioDevice,(SDL_AudioDeviceID a, const SDL_AudioSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_AudioStream*,SDL_OpenAudioDeviceStream,(SDL_AudioDeviceID a, const SDL_AudioSpec *b, SDL_AudioStreamCallback c, void *d),(a,b,c,d),return) diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c index e4928d379..7c03b3914 100644 --- a/src/events/SDL_quit.c +++ b/src/events/SDL_quit.c @@ -172,14 +172,14 @@ void SDL_SendPendingSignalEvents(void) #ifdef SDL_BACKGROUNDING_SIGNAL if (send_backgrounding_pending) { send_backgrounding_pending = SDL_FALSE; - SDL_OnApplicationWillResignActive(); + SDL_OnApplicationWillEnterBackground(); } #endif #ifdef SDL_FOREGROUNDING_SIGNAL if (send_foregrounding_pending) { send_foregrounding_pending = SDL_FALSE; - SDL_OnApplicationDidBecomeActive(); + SDL_OnApplicationDidEnterForeground(); } #endif #endif diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index cabc88a8a..3dc6589ec 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5497,7 +5497,7 @@ void SDL_OnApplicationDidReceiveMemoryWarning(void) SDL_SendAppEvent(SDL_EVENT_LOW_MEMORY); } -void SDL_OnApplicationWillResignActive(void) +void SDL_OnApplicationWillEnterBackground(void) { if (_this) { SDL_Window *window; @@ -5519,7 +5519,7 @@ void SDL_OnApplicationWillEnterForeground(void) SDL_SendAppEvent(SDL_EVENT_WILL_ENTER_FOREGROUND); } -void SDL_OnApplicationDidBecomeActive(void) +void SDL_OnApplicationDidEnterForeground(void) { SDL_SendAppEvent(SDL_EVENT_DID_ENTER_FOREGROUND); diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index eeafc5fb6..bba14f13d 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -71,12 +71,12 @@ static BOOL UIKit_EventPumpEnabled = YES; - (void)applicationDidBecomeActive { - SDL_OnApplicationDidBecomeActive(); + SDL_OnApplicationDidEnterForeground(); } - (void)applicationWillResignActive { - SDL_OnApplicationWillResignActive(); + SDL_OnApplicationWillEnterBackground(); } - (void)applicationDidEnterBackground