Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting a drag event and finishing it outside the window still results in a crash #35

Open
Dev-Owl opened this issue Oct 3, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Dev-Owl
Copy link
Collaborator

Dev-Owl commented Oct 3, 2022

ListMixin.firstWhere (dart:collection/list.dart:167)
Input.onPointerRemoved (/Users/christian/Development/backbone/lib/prelude/input/mod.dart:97)
_BackboneGameWidgetState._handleEvent (/Users/christian/Development/backbone/lib/widget.dart:88)
PointerRouter._dispatch (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/pointer_router.dart:98)
PointerRouter._dispatchEventToRoutes.<anonymous closure> (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/pointer_router.dart:143)
_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617)
PointerRouter._dispatchEventToRoutes (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/pointer_router.dart:141)
PointerRouter.route (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/pointer_router.dart:133)
GestureBinding.dispatchEvent (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/binding.dart:423)
RendererBinding.dispatchEvent (/Users/christian/Development/flutter/packages/flutter/lib/src/rendering/binding.dart:337)
GestureBinding._handlePointerEventImmediately (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/binding.dart:395)
GestureBinding.handlePointerEvent (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/binding.dart:357)
GestureBinding._flushPointerEventQueue (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/binding.dart:314)
GestureBinding._handlePointerDataPacket (/Users/christian/Development/flutter/packages/flutter/lib/src/gestures/binding.dart:295)
_invoke1 (dart:ui/hooks.dart:167)
PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:341)
_dispatchPointerDataPacket (dart:ui/hooks.dart:94)
@Dev-Owl Dev-Owl added the bug Something isn't working label Oct 3, 2022
@Dev-Owl Dev-Owl added this to the Alpha 0.0.1 milestone Oct 3, 2022
@Dev-Owl
Copy link
Collaborator Author

Dev-Owl commented Feb 11, 2023

@skyne98 Please have a look at this, the current combination of Flutter & Flame events are quite hard to understnad (at least for me) you wrote the system and I guess you have a better idea how to deal with it.

I noticed that the pointer (id) in the remove event is always 0 and that the issue happens because the existing pointer can't be found due to its expected states.
I can't really answer why it's zero all the time and why we just check the two states of PointerStateHover and PointerStateAdded

@Dev-Owl Dev-Owl closed this as completed Feb 11, 2023
@Dev-Owl Dev-Owl reopened this Feb 11, 2023
@skyne98
Copy link
Contributor

skyne98 commented Feb 14, 2023

Might be addressed by my PR here 👀 Will test on my branch and see if it still fails there! It now uses only specific Flutter events, which are all children of PointerEvent.

@skyne98
Copy link
Contributor

skyne98 commented Feb 14, 2023

Looks like it does fix it, upon merging the PR, @Dev-Owl, can you please confirm the issue doesn't happen anymore and close this (#35) and #68?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants