Skip to content

Fix SceneGraphPriority pointer event sync, ProtectedNode traversal, and PC focus-loss cancel - #3446

Merged
halx99 merged 5 commits into
axmolengine:devfrom
simdsoft:fix-3365
Dec 1, 2026
Merged

halx99 merged 5 commits into
axmolengine:devfrom
simdsoft:fix-3365

Conversation

@halx99

@halx99 halx99 commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Related to #3365 (kept as a soft reference pending confirmation from the original reporter).

This PR addresses several EventDispatcher and PC RenderView issues that can cause SceneGraphPriority PointerEventListeners to stop receiving events or get stuck in inconsistent capture/pause states:

  1. Scene-root tracking & missing-target resync in EventDispatcher

    • Track the scene root (_sortedSceneRoot) used when _nodePriorityMap was last built and force DirtyFlag::SCENE_GRAPH_PRIORITY whenever the running scene changes (e.g., after a TransitionScene switch where Director::setNextScene() skips onEnter()).
    • Resync _nodePriorityMap in dispatchUnclaimedPointerEvent() and hitTestPointerEvent() if an active, running SceneGraphPriority target is missing from _nodePriorityMap.
  2. Consistent ProtectedNode recursion in EventDispatcher

    • Traverse ProtectedNode::getProtectedChildren() in pauseEventListenersForTarget, resumeEventListenersForTarget, removeEventListenersForTarget (when recursive == true), and setDirtyForNode, matching visitTarget().
  3. Claimed pointer cleanup & PC window focus-loss reset

    • Skip delivering claimed PointerMove events to disabled or paused listeners.
    • On PC window focus loss (RenderView::onGLFWWindowFocusCallback), clear _pressedButtons (guarded for non-WASM builds) and call InputSystem::getInstance()->resetInput() so active pointer captures receive PointerCancel.

Tests

  • Unit tests (tests/unit-tests/Source/axmol/base/EventDispatcherTests.cpp, TEST_SUITE("base/EventDispatcher")):
    • SceneGraphPriority_DeliversEventsAfterTransitionSceneSwitch
    • SceneGraphPriority_ProtectedNodeChildrenPauseAndResume
    • ClaimedPointerListener_RespectsPausedStateAndResetInputCancel
  • Interactive test (tests/cpp-tests/Source/EventDispatcherTest):
    • Added PointerEventSyncTest covering SceneGraphPriority vs FixedPriority, ProtectedNode recursive pause/resume, window focus-loss PointerCancel, and TransitionFade.

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Simdsoft Limited."

  • Copyright notice guidance:
    - Axmol source files generally use the Simdsoft notice above.
    - Project-wide contributor attribution is maintained in LICENSE and AUTHORS.md.
    - Do not remove historical upstream or third-party copyright notices from files that already contain them.

  • I have signed the Axmol Contributor Agreement (or am covered by an Enterprise CCA).

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

Axmol 3.x ------------------------------------------------------------

For each 3.x PR

  • Check the '#include "axmol.h"' and replace it with the needed headers.

…engine#3365)

- Add unit tests in EventDispatcherTests (TransitionScene, ProtectedNode, claimed pause/resetInput)
- Add Issue3365 interactive test case in cpp-tests EventDispatcherTest
)

- Track sorted scene root in EventDispatcher and resync missing running targets in _nodePriorityMap
- Traverse ProtectedNode::getProtectedChildren() in pause/resume/remove/setDirtyForNode
- Skip paused/disabled claimed listeners on PointerMove and reset mouse buttons/input on PC window focus loss
@halx99

halx99 commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator Author

/clang-format

@halx99 halx99 added this to the 3.0.0 milestone Nov 30, 2026
@halx99 halx99 changed the title Fix #3365 Fix SceneGraphPriority pointer event sync, ProtectedNode traversal, and PC focus-loss cancel Nov 30, 2026
@halx99
halx99 merged commit 00ca071 into axmolengine:dev Dec 1, 2026
61 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants