2906 Commits

Author SHA1 Message Date
stuartmorgan
46e3bba999
Defer Windows arrow key and delete handling (#22207)
The framework handles arrow keys, delete, and backspace (and with better
unicode support), so we shouldn't handle them at the embedding level.

Fixes #69202
2020-11-02 11:09:03 -08:00
chunhtai
9b4bb20ac9
makes android semanticsnode to ignore hittest if it is not focusable (#22205) 2020-11-02 09:53:01 -08:00
gaaclarke
4e9459e007
Refactored the FlutterEngine to make it easier to implement spawn functionality (#21890) 2020-10-30 15:29:10 -07:00
Kaushik Iska
37d766c0dc
Fix includes to start with shell (#22227)
See b/172031915
2020-10-30 08:51:32 -07:00
Robert Ancell
8d3d953192
Fix warning when no entrypoing args provided. (#22136)
Fixes errors like:
GLib-CRITICAL **: 14:20:17.248: g_strv_length: assertion 'str_array != NULL' failed

Introduced in fc72bd2ada5d8d9b4ab2c1255d4f960cc44b5de0
2020-10-30 14:57:35 +13:00
Robert Ancell
382f5ccba5
Fix incorrect parameter used for self object (#22135)
Fix incorrect parameter used for self object

Rename the GWeakNotify function parameters.
This matches the prototype and makes it harder to accidentally use the object
parameter the wrong way.
2020-10-30 14:52:24 +13:00
Lazy Llama
7d6180c301
Fix viewInset.bottom and viewPadding.bottom… (#21730) 2020-10-29 17:28:01 -07:00
Kaushik Iska
99cc50dfff
[ios] Surface factory holds the canonical reference to the external view embedder (#22206)
This furthers the refactor of making platform view hold the reference to
the external view embedder on iOS.
2020-10-29 16:47:31 -07:00
mikaelpessa
7a7804b6d3
Add "input shield" to capture pointer input for reinjection (#22067) 2020-10-29 15:23:02 -07:00
J-P Nurmi
bb32446c68
Fix FlTextInputPlugin tear down (#22007) 2020-10-29 15:18:04 -07:00
J-P Nurmi
28497c864b
Fix typos in FlValue docs (#21875) 2020-10-29 15:13:04 -07:00
Anirudh Balaji
b457e2dd85
Refactor make_mock_engine into fl_test (#21585) 2020-10-29 15:08:03 -07:00
stuartmorgan
caf32d5b28
Add a proc table version of embedder API (#21813) 2020-10-29 13:13:03 -07:00
Kaushik Iska
f81bc371c0
[profiling] Handle thread_info to account for killed threads (#22170)
Fixes: https://github.com/flutter/flutter/issues/63025
2020-10-29 12:06:16 -07:00
Kaushik Iska
d6627c6a7d
Reland [ios] Refactor IOSSurface factory and unify surface creation (#22016) 2020-10-29 11:58:03 -07:00
stuartmorgan
06b0910e2d
Fix possible use of std::moved value in Rasterizer (#22125) 2020-10-28 18:12:03 -07:00
George Wright
62d50af37e
Add plumbing for command line arguments on Windows (#22094) 2020-10-28 18:07:03 -07:00
Alexander Brusher
0270632d85
Includes roles for links, checkboxes, and radio buttons in semantics (#22061) 2020-10-28 18:02:02 -07:00
Matej Knopp
e61e8c2482
Smooth window resizing on macOS (#21525) 2020-10-28 11:12:04 -07:00
stuartmorgan
c896d6d1bb
Defer macOS arrow and backspace handling to framework (#22063)
The Flutter framework now has handling for arrow keys and backspace
in its editable text, so they no longer need to be handled in the
embedding. This not only avoids duplicate work, but improves the
handling of complex unicode (surrogate pairs, grapheme clusters) which
are currently correctly handled in the framework but not the macOS
embedding.

Fixes https://github.com/flutter/flutter/issues/68497
2020-10-26 12:56:30 -07:00
Kaushik Iska
a598f23763
[ios] Convert FlutterPlatformViewsController to smart pointer (#22082)
* Convert FlutterPlatformViewsController to smart pointer

* have a const reference of platform views controller

* change more stuff to references
2020-10-26 09:45:09 -07:00
gaaclarke
25bb31ef68
Added the ability to set the initial route via launch urls. (#21336) 2020-10-26 09:31:23 -07:00
Jason Simmons
5677d3dea5
Reformat some files that were not auto-formatted (#21940) 2020-10-23 18:57:03 -07:00
Filip Filmar
992689c70d
[fuchsia] Adds a test for timezone change (#21934) 2020-10-23 18:52:02 -07:00
chunhtai
742dfbefad
support uri intent launcher in android (#21275)
* support uri intent launcher in android

* fix comment
2020-10-22 15:54:30 -07:00
Lau Ching Jun
3d27fd5b2c
Support loading assets from Android dynamic feature modules (#21504)
Initialize the AssetManager from the application context so that assets from dynamic feature modules can be loaded.
2020-10-22 15:53:11 -07:00
Robert Ancell
5ca5e2614b
Add FlEventChannel (#21316)
Related to https://github.com/flutter/flutter/issues/65270
2020-10-22 15:06:52 -07:00
Greg Spencer
6bc70e4a11
Reland: Migration to PlatformDispatcher and multi-window (#21932)
This re-lands #20496 and #21780 after fixing the semantics-enabling code that was causing the post-submit web_smoke_test to fail.

Below is the description from the original PR:

This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-22 14:54:25 -07:00
chunhtai
aed8e019be
Fixes Edge trigger route change announcement (#21975) 2020-10-22 14:22:03 -07:00
stuartmorgan
1233fe4902
Revert "Revert "Explicitly make the X connection for EGL. (#21831)" (#21851)" (#21871)
This reverts commit d2ea378be45dd0de7a86b521d48240fd9d276283.
2020-10-22 13:50:14 -07:00
Kaushik Iska
326b202cc7
Reland fuchsia external view embedder will be shared with platform view (#22008)
* Reland fuchsia external view embedder will be shared with platform view

This reverts commit 9b752790f4d25ab238576c719208d7a38c6293f3.

* wait for the external view embedder to be initialized before creating
shell
2020-10-22 13:48:36 -07:00
Chinmay Garde
defa8be2b1
Isolates launched by the engine instance use the settings of that instance. (#22052)
This regression was introduced in https://github.com/flutter/engine/pull/21820
for sound-null safety. The settings used to launch the VM were incorrectly used
to determine the isolate lifecycle callbacks. Since the first shell/engine in
the process also starts the VM, these objects are usually identical. However,
for subsequent engine shell/engine launches, the callbacks attached to the new
settings object would be ignored. The unit-test harness is also structured in
such a way that each test case tears down the VM before the next. So all
existing tests created a bespoke VM for the test run, and, the tests that did
create multiple isolates did not also test attaching callbacks to the settings
object.

Fixes https://github.com/flutter/engine/pull/22041
2020-10-22 02:20:50 -07:00
Chinmay Garde
f459a86610
Ensure root isolate create callback is invoked before the isolate is in the running phase. (#22041)
Embedders that have access to the Dart native API (only Fuchsia now) may perform
library setup in the isolate create callback. The engine used to depend on the
fact the root isolate entrypoint is invoked in the next iteration of message
loop (via the `_startIsolate` trampoline in `isolate_patch.dart`) to ensure that
library setup occur before the main entrypoint was invoked. However, due to
differences in the way in which message loops are setup in Fuchsia, this
entrypoint was run before the callback could be executed. Dart code on Fuchsia
also has the ability to access the underlying event loops directly. This patch
moves the invocation of the create callback to before user dart code has a
chance to run. This difference in behavior on Fuchsia became an issue when the
isolate initialization was reworked in https://github.com/flutter/engine/pull/21820
for null-safety.

Another issue was discovered in that the callback was being invoked twice, I
fixed that too and added a test.

Fixes https://github.com/flutter/flutter/issues/68732
2020-10-21 15:57:10 -07:00
George Wright
fc72bd2ada
Plumb through Dart entrypoint arguments on the Linux embedder (#21933) 2020-10-22 09:47:04 +13:00
Adam Barth
638c182366
[fuchsia] zx::vmar::map migration (#22003)
The new map() method receives its arguments in the same order as the
underlying C system call. This patch should not change any behavior.
2020-10-20 21:59:46 +00:00
Chase Latta
8a5b423445
[fuchsia] opt-out null-safety in standalone scripts (#22009) 2020-10-20 14:47:01 -07:00
Greg Spencer
3658bd7ea7
Revert "Reland: Use dispatchKeyEventPreIme, and handle keys sent to InputConnection.sendKeyEvent on Android (#21979)" (#22004)
This reverts commit 3cd70f2cfb21baf30cc62de29d311118aa757c60 because it causes some failures in web tests.
2020-10-20 11:42:01 -07:00
Wu Zhong
a82e917dc2
[iOS] Fixes leaks of presses key message (#21987)
Related PR: #20972
2020-10-20 10:15:44 -07:00
Greg Spencer
3cd70f2cfb
Reland: Use dispatchKeyEventPreIme, and handle keys sent to InputConnection.sendKeyEvent on Android (#21979)
This re-lands #21163, which was reverted in #21513

Now that flutter/flutter#67359 has landed, this change will no longer cause spaces (and other shortcuts) to be ignored in text fields if there is no action associated with the intent, even if there is a shortcut key mapping to an intent.

Here's the original PR description:

This switches from using dispatchKeyEvent to using dispatchKeyEventPreIme so that keys can be intercepted before they reach the IME and be handled by the framework.

It also now intercepts key events sent to InputConnection.sendKeyEvent, as some IMEs do (e.g. the Hacker's Keyboard), and sends the to Flutter before sending them to the IME (which it now only does if they are not handled by the framework).

This fixes the problem where pressing TAB on a hardware keyboard sends the tab to both the text field and to the focus traversal system.

Note that we still can't intercept all keystrokes given to a soft keyboard, only those which the soft keyboard decides to send to InputConnection.sendKeyEvent.
2020-10-20 10:14:31 -07:00
Damian Wrobel
91c81ebfae
Fix linking issue (missing wayland-client library) (#21408)
As fl_renderer_wayland.cc uses directly some of the wayland-client
related functions it should also add this library as a dependency.
2020-10-20 05:47:40 -07:00
Clement Skau
e78e405e6a
Enable lazy-async-stacks by-default in all modes (Take 4) (#21802) 2020-10-20 10:31:15 +02:00
Chinmay Garde
fa11ee6e2a
Fix native constructor of list of zircon handles and remove unused list factory specializations. (#21980) 2020-10-19 19:42:01 -07:00
Jenn Magder
0c7c477245
Revert "[ios] Refactor IOSSurface factory and unify surface creation (#21877)" (#21970) 2020-10-19 16:32:03 -07:00
Chris Bracken
bcc557f1ba
Add multi-step input method support for Linux (#21897)
This implements the Gtk hooks required to support multi-step input
methods on Linux. This builds on the support for composing regions
(preedit region in Gtk terminology) added to TextInputModel in
https://github.com/flutter/engine/pull/21682.

Specifically, the following changes are included:

1. Add handler for TextInput.setMarkedTextRegion framework messages: On
any change to the EditableText in the framework, this message is sent
which provides an updated rect (in the local co-ordinates of the
EditableText) for the composing region. If not in composing mode, the
cursor rect is sent.

2. Add handler for TextInput.setEditableSizeAndTransform framework messages:
On any change to the RenderObject underlying the EditableText, an
updated size for the full EditableText widget, as well as an affine
transform matrix from local co-ordinates to Flutter root co-ordinates is
sent.

3. On either of the above messages, we use the transformed composing
rect to compute the cursor position in Gtk window co-ordinates and
inform Gtk, so that it can position any system IM composing window
correctly for on-the-spot composing, such as is used when inputting
Japanese text.

4. Adds handlers for preedit-start, preedit-changed, and preedit-end
signals from Gtk. These are passed on to the TextInputModel.

5. Updates the preedit-commit handler to commit the composing region to
the text or, if not composing, insert new text at the cursor.

6. Updates the handler for TextInput.setEditingState framework messages
to extract the composing range base and extent and pass these on to
TextInputModel.

7. Updates update_editing_state function to set composing base and
extent on text input state updates sent to the framework.
2020-10-19 16:25:56 -07:00
J-P Nurmi
9946be45a9
FlTextInputPlugin: fix memory leaks (#21879)
This PR fixes a few small memory leaks in FlTextInputPlugin. All three cases
are creating temporary FlValue instances for lookups and comparison without
ever releasing them.
2020-10-19 16:23:10 -07:00
Jason Simmons
a6857802b7
Fix the initialization of AndroidSurfaceFactoryImpl (#21977)
Fixes https://github.com/flutter/flutter/issues/68446
2020-10-19 16:22:36 -07:00
puelo
43b618e4bf
Added keyEvent support for iOS 13.4+ (#20972) 2020-10-19 16:22:02 -07:00
Chris Bracken
49c35b6177
Eliminate unnecessary linter opt-outs (#21935)
Eliminates FLUTTER_NOLINT where they can be landed without triggering
lint failures.
2020-10-16 17:24:23 -07:00
Chris Bracken
b8fd0013a8
Update FLUTTER_NOLINT uses to include issue link (#21921)
In an upcoming patch, we'll enable enforcement that all FLUTTER_NOLINT
comments include an issue link. This migrates the remaining uses to that
format.

Bug: https://github.com/flutter/flutter/issues/68273
2020-10-16 16:08:36 -07:00
George Wright
04bf8791fe
Add plumbing to grab dart entrypoint args on macOS (#21789) 2020-10-16 16:07:02 -07:00