From e7966af977f6e2afe4a039700dde2a5b96684d57 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 14 Nov 2025 22:57:39 -0500 Subject: [PATCH] Make sure onFocusLost gets called on substates. --- flixel/FlxState.hx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flixel/FlxState.hx b/flixel/FlxState.hx index ade5b320fc..cba628dfb9 100644 --- a/flixel/FlxState.hx +++ b/flixel/FlxState.hx @@ -202,13 +202,17 @@ class FlxState extends FlxContainer * This method is called after the game loses focus. * Can be useful for third party libraries, such as tweening engines. */ - public function onFocusLost():Void {} + public function onFocusLost():Void { + if (subState != null) subState.onFocusLost(); + } /** * This method is called after the game receives focus. * Can be useful for third party libraries, such as tweening engines. */ - public function onFocus():Void {} + public function onFocus():Void { + if (subState != null) subState.onFocus(); + } /** * This function is called whenever the window size has been changed.