Skip to content

Change how navigator prevents redundant operations - #4769

Merged
abarth merged 4 commits into
flutter:masterfrom
abarth:absorb_pointer
Jun 27, 2016
Merged

abarth merged 4 commits into
flutter:masterfrom
abarth:absorb_pointer

Conversation

@abarth

@abarth abarth commented Jun 27, 2016

Copy link
Copy Markdown
Contributor

Instead of requiring transactions, we now cancel all active pointers that
are interacting with the navigator and absorb future pointers until we get
a chance to build. This approach isn't perfect (e.g., events that trigger
off the cancelled pointers could still interact with the navigator), but it
should be better than the current transaction-based approach.

Fixes #4716

abarth added 3 commits June 27, 2016 11:59
Instead of requiring transactions, we now cancel all active pointers that are
interacting with the navigator and absorb future pointers until we get a chance
to build. This approach isn't perfect (e.g., events that trigger off the
cancelled pointers could still interact with the navigator), but it should be
better than the current transaction-based approach.

Fixes flutter#4716
absorber?.absorbing = true;
}
for (int pointer in _activePointers.toList())
WidgetsBinding.instance.cancelPointer(pointer);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will also cancel gesture recognisers dealing with those pointers outside the navigator.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(add this to our "we still need to fix this for real" bug)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for clarity and for copy-paste sanity, always refer to Navigator.of even within Navigator.

@Hixie

Hixie commented Jun 27, 2016

Copy link
Copy Markdown
Contributor

LGTM

@abarth abarth mentioned this pull request Jun 27, 2016
@abarth
abarth merged commit 2af668f into flutter:master Jun 27, 2016
@abarth
abarth deleted the absorb_pointer branch June 27, 2016 20:07
aam added a commit to aam/flutter that referenced this pull request Mar 12, 2018
Changes since last roll:
```
b6df7a6 Roll dart to 290c576264faa096a0b3206c71b2435309d9f904. (flutter#4771)
a6764db Add sources for Fuchsia target. (flutter#4763)
2d59006 [fuchsia] Remove unused header file. (flutter#4769)
9717063 Revert "Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (flutter#4767)" (flutter#4768)
9a98143 Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (flutter#4767)
e74e8b3 [async] Update includes of async headers to new path (flutter#4760)
e2c4b27 Use Dart 2 camel case constants in the engine Dart libraries (flutter#4766)
9c1e484 Updates for Fuchsia roll. (flutter#4765)
14c940e Switch from fxl::Mutex to std::mutex (flutter#4764)
debf82c Roll Garnet (flutter#4759)
5bffdef Use weak pointers to the accesibility bridge from objects vended to the UIKit accessibility framework. (flutter#4761)
```
aam added a commit that referenced this pull request Mar 12, 2018
* Roll engine to b6df7a6.

Changes since last roll:
```
b6df7a6 Roll dart to 290c576264faa096a0b3206c71b2435309d9f904. (#4771)
a6764db Add sources for Fuchsia target. (#4763)
2d59006 [fuchsia] Remove unused header file. (#4769)
9717063 Revert "Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (#4767)" (#4768)
9a98143 Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (#4767)
e74e8b3 [async] Update includes of async headers to new path (#4760)
e2c4b27 Use Dart 2 camel case constants in the engine Dart libraries (#4766)
9c1e484 Updates for Fuchsia roll. (#4765)
14c940e Switch from fxl::Mutex to std::mutex (#4764)
debf82c Roll Garnet (#4759)
5bffdef Use weak pointers to the accesibility bridge from objects vended to the UIKit accessibility framework. (#4761)
```
cdotstout pushed a commit to cdotstout/flutter that referenced this pull request Apr 3, 2018
DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
* Roll engine to b6df7a6.

Changes since last roll:
```
b6df7a6 Roll dart to 290c576264faa096a0b3206c71b2435309d9f904. (flutter#4771)
a6764db Add sources for Fuchsia target. (flutter#4763)
2d59006 [fuchsia] Remove unused header file. (flutter#4769)
9717063 Revert "Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (flutter#4767)" (flutter#4768)
9a98143 Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (flutter#4767)
e74e8b3 [async] Update includes of async headers to new path (flutter#4760)
e2c4b27 Use Dart 2 camel case constants in the engine Dart libraries (flutter#4766)
9c1e484 Updates for Fuchsia roll. (flutter#4765)
14c940e Switch from fxl::Mutex to std::mutex (flutter#4764)
debf82c Roll Garnet (flutter#4759)
5bffdef Use weak pointers to the accesibility bridge from objects vended to the UIKit accessibility framework. (flutter#4761)
```
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigator.push does not work within a PopupMenuButton

2 participants