Skip to content

core: Add object1_or_null and use it when firing onSetFocus/onKillFocus#23230

Merged
kjarosh merged 1 commit intoruffle-rs:masterfrom
ChrisCPI:fix-onsetfocus-mixedavm
Mar 11, 2026
Merged

core: Add object1_or_null and use it when firing onSetFocus/onKillFocus#23230
kjarosh merged 1 commit intoruffle-rs:masterfrom
ChrisCPI:fix-onsetfocus-mixedavm

Conversation

@ChrisCPI
Copy link
Contributor

@ChrisCPI ChrisCPI commented Mar 10, 2026

Fixes an issue where, when an AVM1 movie listening for Selection.onSetFocus (or onSetFocus/onKillFocus on a display object) is loaded by AVM2, then focusing on an AVM2 interactive object would result in undefined instead of null being given in the event.

@Lord-McSweeney Lord-McSweeney added A-avm1 Area: AVM1 (ActionScript 1 & 2) waiting-on-review Waiting on review from a Ruffle team member T-fix Type: Bug fix (in something that's supposed to work already) labels Mar 11, 2026
@ChrisCPI ChrisCPI force-pushed the fix-onsetfocus-mixedavm branch from c384498 to 1bc171d Compare March 11, 2026 02:23
@ChrisCPI ChrisCPI changed the title core: Fix mapping of old/new values when firing Selection.onSetFocus core: Fix mapping of object1 values when firing onSetFocus/onKillFocus Mar 11, 2026
@ChrisCPI
Copy link
Contributor Author

Updated to account for individual onSetFocus/onKillFocus listeners, since they also had this bug.

@kjarosh kjarosh added the mixed-avm Mixing AVM1 and AVM2 label Mar 11, 2026
@ChrisCPI ChrisCPI force-pushed the fix-onsetfocus-mixedavm branch from 1bc171d to fc87772 Compare March 11, 2026 17:05
@ChrisCPI ChrisCPI changed the title core: Fix mapping of object1 values when firing onSetFocus/onKillFocus core: Add object1_or_null and use it when firing onSetFocus/onKillFocus Mar 11, 2026
@ChrisCPI ChrisCPI requested a review from kjarosh March 11, 2026 17:17
Copy link
Member

@kjarosh kjarosh left a comment

Choose a reason for hiding this comment

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

Thank you!

Fixes an issue where, when an AVM1 movie listening for `Selection.onSetFocus` (or `onSetFocus`/`onKillFocus` on a display object) is loaded by AVM2, then focusing on an AVM2 interactive object would result in `undefined` instead of `null` being given in the event.
@kjarosh kjarosh force-pushed the fix-onsetfocus-mixedavm branch from fc87772 to 03a2fc7 Compare March 11, 2026 20:06
@kjarosh kjarosh enabled auto-merge (rebase) March 11, 2026 20:06
@kjarosh kjarosh removed the waiting-on-review Waiting on review from a Ruffle team member label Mar 11, 2026
@kjarosh kjarosh merged commit 20c1335 into ruffle-rs:master Mar 11, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm1 Area: AVM1 (ActionScript 1 & 2) mixed-avm Mixing AVM1 and AVM2 T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants