diff --git a/core/src/display_object/avm1_button.rs b/core/src/display_object/avm1_button.rs index 095ed6a5e..858e41ff5 100644 --- a/core/src/display_object/avm1_button.rs +++ b/core/src/display_object/avm1_button.rs @@ -610,12 +610,11 @@ impl<'gc> TInteractiveObject<'gc> for Avm1Button<'gc> { fn on_focus_changed( &self, - context: &mut UpdateContext<'_, 'gc>, + _context: &mut UpdateContext<'_, 'gc>, focused: bool, - other: Option>, + _other: Option>, ) { self.0.has_focus.set(focused); - self.call_focus_handler(context, focused, other); } fn tab_enabled_avm1(&self, context: &mut UpdateContext<'_, 'gc>) -> bool { diff --git a/core/src/display_object/avm2_button.rs b/core/src/display_object/avm2_button.rs index 07c80bcc8..5eaa450f6 100644 --- a/core/src/display_object/avm2_button.rs +++ b/core/src/display_object/avm2_button.rs @@ -826,12 +826,11 @@ impl<'gc> TInteractiveObject<'gc> for Avm2Button<'gc> { fn on_focus_changed( &self, - context: &mut UpdateContext<'_, 'gc>, + _context: &mut UpdateContext<'_, 'gc>, focused: bool, - other: Option>, + _other: Option>, ) { self.0.has_focus.set(focused); - self.call_focus_handler(context, focused, other); } fn tab_enabled_avm2_default(&self, _context: &mut UpdateContext<'_, 'gc>) -> bool { diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index 3086dfb86..357b5b74b 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -2457,7 +2457,7 @@ impl<'gc> TInteractiveObject<'gc> for EditText<'gc> { &self, context: &mut UpdateContext<'_, 'gc>, focused: bool, - other: Option>, + _other: Option>, ) { let is_action_script_3 = self.movie().is_action_script_3(); let mut text = self.0.write(context.gc_context); @@ -2465,9 +2465,6 @@ impl<'gc> TInteractiveObject<'gc> for EditText<'gc> { if !focused && !is_action_script_3 { text.selection = None; } - drop(text); - - self.call_focus_handler(context, focused, other); } fn is_highlightable(&self, _context: &mut UpdateContext<'_, 'gc>) -> bool { diff --git a/core/src/display_object/movie_clip.rs b/core/src/display_object/movie_clip.rs index 246286372..f1a09815b 100644 --- a/core/src/display_object/movie_clip.rs +++ b/core/src/display_object/movie_clip.rs @@ -3390,10 +3390,9 @@ impl<'gc> TInteractiveObject<'gc> for MovieClip<'gc> { &self, context: &mut UpdateContext<'_, 'gc>, focused: bool, - other: Option>, + _other: Option>, ) { self.0.write(context.gc_context).has_focus = focused; - self.call_focus_handler(context, focused, other); } fn tab_enabled_avm1(&self, context: &mut UpdateContext<'_, 'gc>) -> bool { diff --git a/core/src/focus_tracker.rs b/core/src/focus_tracker.rs index ac8714ea5..f492d941b 100644 --- a/core/src/focus_tracker.rs +++ b/core/src/focus_tracker.rs @@ -99,9 +99,11 @@ impl<'gc> FocusTracker<'gc> { if let Some(old) = old { old.on_focus_changed(context, false, new); + old.call_focus_handler(context, false, new); } if let Some(new) = new { new.on_focus_changed(context, true, old); + new.call_focus_handler(context, true, old); } tracing::info!("Focus is now on {:?}", new);