Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@robert-ancell
Copy link
Contributor

Add missing tests for this function.

Note this makes FlKeyboardManager a bit more complex, but this is planned to be simplified in a future refactor.

Add missing tests for this function.

Note this makes FlKeyboardManager a bit more complex, but this is planned to be
simplified in a future refactor.
Copy link

@mattkae mattkae left a comment

Choose a reason for hiding this comment

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

I have a design question, but feel free to ignore if you have a good reason for doing otherwise

static_cast<SendKeyEventData*>(user_data);
gboolean handled = FALSE;
g_autoptr(GError) error = nullptr;
if (!fl_engine_send_key_event_finish(
Copy link

Choose a reason for hiding this comment

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

Would it make more sense for fl_engine_send_key_event to call fl_engine_send_key_event_finish automatically for us before calling the user provided callback? If it always has to be called after fl_engine_send_key_event gets called, it would make sense to encapsulate it at that level instead of putting the onus on the caller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the way that GObject does asynchronous calls, the purpose of this change is to make all the code more consistent and reliable (in particular by using GCancellable to make sure all async calls are correctly aborted if the caller is disposed before a call completes). I'm not sure the history of why this pattern was chosen. Some ideas of why it might not be desirable to do the finish internally:

  • This would require making custom callbacks for each function, which might be considered harder to write and have difficulty with language bindings.
  • The finish completes the async call, which might do some specific behaviour. The callback only indicates the function is ready to finish, you might store the GAsyncResult and do it later or chain it into another async call.

@robert-ancell robert-ancell merged commit 3bba62b into flutter:main Dec 12, 2024
28 checks passed
@robert-ancell robert-ancell deleted the linux-engine-send-key-event-async branch December 12, 2024 20:21
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 13, 2024
…160220)

flutter/engine@9b51e30...5eedfef

2024-12-13 [email protected] Normalize round rect bounds when coming from
Flutter (flutter/engine#57171)
2024-12-13 [email protected] [ios]enable
the webview non tappable workaround by checking subviews recursively
(flutter/engine#57168)
2024-12-12 [email protected] removed c style
casts and enabled the lint (flutter/engine#57162)
2024-12-12 [email protected] [Impeller] exploit perfect hash for
SamplerDescriptor. (flutter/engine#57036)
2024-12-12 [email protected] Reenabled
labelling test with a capabilities check. (flutter/engine#57160)
2024-12-12 [email protected] [Impeller] dont print format strings
for blend filter and snapshots. (flutter/engine#57105)
2024-12-12 [email protected] Make fl_engine_send_key_event
into a standard async function. (flutter/engine#57112)
2024-12-12 [email protected] Roll Fuchsia Linux SDK from
HJ57Y3zxqDamI8qkY... to iWMEbVYaNdH8RJmXZ... (flutter/engine#57163)
2024-12-12 [email protected] Migrate FlPlatformChannel tests
to FlMockBinaryMessenger (flutter/engine#57140)
2024-12-12 [email protected] Migrate FlBasicMessageChannel
tests to FlMockBinaryMessenger (flutter/engine#57115)
2024-12-12 [email protected] Migrate layers and layer_tree to
DisplayList/Impeller geometry classes (flutter/engine#57153)
2024-12-12 [email protected] [web] Use CanvasKit to run tests under
engine/ (flutter/engine#54786)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from HJ57Y3zxqDam to iWMEbVYaNdH8

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to
ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…r/engine#57112)

Add missing tests for this function.

Note this makes FlKeyboardManager a bit more complex, but this is
planned to be simplified in a future refactor.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants