2463 Commits

Author SHA1 Message Date
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
Ren You
9b752790f4
Revert "[fuchsia] External view embedder will be shared with platform view (#21850)" (#21924)
This reverts commit 1bc025d6cbf1136c2e96c6fb041d24202ea47ff0.
2020-10-16 15:25:13 -07:00
Jason Simmons
787b9c5376
Break the reference cycle between the surface factory and the external view embedder (#21918)
See https://github.com/flutter/flutter/issues/68315
2020-10-16 15:03:26 -07:00
Chinmay Garde
5bd7260a1e
Enable loading snapshots with sound null safety enabled. (#21820)
Snapshots compiled with sound null-safety enabled require changes to the way in
which isolates are launched. Specifically, the `Dart_IsolateFlags::null_safety`
field needs to be known upfront. The value of this field can only be determined
once the kernel snapshot is available. This poses a problem in the engine
because the engine used to launch the isolate at shell initialization and only
need the kernel mappings later at isolate launch (when transitioning the root
isolate to the `DartIsolate::Phase::Running` phase). This patch delays launch of
the isolate on the UI task runner till a kernel mapping is available. The side
effects of this delay (callers no longer having access to the non-running
isolate handle) have been addressed in this patch. The DartIsolate API has also
been amended to hide the method that could return a non-running isolate to the
caller.  Instead, it has been replaced with a method that requires a valid
isolate configuration that returns a running root isolate. The isolate will be
launched by asking the isolate configuration for its null-safety
characteristics.

A side effect of enabling null-safety is that Dart APIs that work with legacy
types will now terminate the process if used with an isolate that has sound
null-safety enabled. These APIs may no longer be used in the engine. This
primarily affects the Dart Convertors in Tonic that convert certain C++ objects
into the Dart counterparts. All known Dart Converters have been updated to
convert C++ objects to non-nullable Dart types inferred using type traits of the
corresponding C++ object. The few spots in the engine that used the old Dart
APIs directly have been manually updated. To ensure that no usage of the legacy
APIs remain in the engine (as these would cause runtime process terminations),
the legacy APIs were prefixed with the `DART_LEGACY_API` macro and the macro
defined to `[[deprecated]]` in all engine translation units. While the engine
now primarily works with non-nullable Dart types, callers can still use
`Dart_TypeToNonNullableType` to acquire nullable types for use directly or with
Tonic. One use case that is not addressed with the Tonic Dart Convertors is the
creation of non-nullable lists of nullable types. This hasn’t come up so far in
the engine.

A minor related change is reworking tonic to define a single library target.
This allows the various tonic subsystems to depend on one another. Primarily,
this is used to make the Dart convertors use the logging utilities. This now
allows errors to be more descriptive as the presence of error handles is caught
(and logged) earlier.

Fixes https://github.com/flutter/flutter/issues/59879
2020-10-16 14:53:26 -07:00
Chris Bracken
c449c8ee50
Eliminate FLUTTER_NOLINT where possible (#21904)
This removes most of the remaining FLUTTER_NOLINT comments and opts
these files back into linter enforcement.

I've filed https://github.com/flutter/flutter/issues/68273 to require
that all FLUTTER_NOLINT comments be followed by a GitHub issue URL
describing the problem to be fixed.
2020-10-16 12:44:49 -07:00
Mehmet Fidanboylu
abdc8d3853
Forward Error objects to uncaught exception handler if there is one. (#21806) 2020-10-16 08:21:04 -07:00
Kaushik Iska
6a3b5feb62
[ios] Refactor IOSSurface factory and unify surface creation (#21877) 2020-10-15 19:56:13 -07:00
Kaushik Iska
62459b3b86
[embedder] Platform View owns lifecycle of external view embedder (#21847)
Changing it to shared_ptr and migrating the ownership from surface
to platform view.
2020-10-15 17:48:14 -07:00
Chris Bracken
44ea9677ad
Add multi-step IME support to TextInputModel (#21682)
* Add multi-step IME support to TextInputModel

This updates the platform-independent TextInputModel to add support for
input method (abbreviated IM or IME) composing regions.

In contrast to languages such as English, where keyboard input is
managed keystroke-by-keystroke, languages such as Japanese require a
multi-step input process wherein the user begins a composing sequence,
during which point their keystrokes are captured by a system input
method and converted into a text sequence. During composing, the user is
able to edit the composing range and manage the conversion from keyboard
input to text before eventually committing the text to the underlying
text input field.

To illustrate this, in Japanese, this sequence might look something like
the following:

1. User types 'k'. The character 'k' is added to the composing region.
   Typically, the text 'k' will be inserted inline into the underlying
   text field but the composing range will be highlighted in some manner,
   frequently with a highlight or underline.
2. User types 'a'. The composing range is replaced with the phonetic
   kana character 'か' (ka). The composing range continues to be
   highlighted.
3. User types 'k'. The character 'k' is appended to the composing
   range such that the highlighted text is now 'かk'
4. User types 'u'. The trailing 'k' is replaced with the phonetic kana
   character 'く' (ku) such that the composing range now reads 'かく'
   The composing range continues to be highlighted.
5. The user presses the space bar to convert the kana characters to
   kanji. The composing range is replaced with '書く' (kaku: to write).
6. The user presses the space bar again to show other conversions. The
   user's configured input method (for example, ibus) pops up a
   completions menu populated with alternatives such as 各 (kaku:
   every), 描く (kaku: to draw), 核 (kaku: pit of a fruit, nucleus), 角
   (kaku: angle), etc.
7. The user uses the arrow keys to navigate the completions menu and
   select the alternative to input. As they do, the inline composing
   region in the text field is updated. It continues to be highlighted
   or underlined.
8. The user hits enter to commit the composing region. The text is
   committed to the underlying text field and the visual highlighting is
   removed.
9. If the user presses another key, a new composing sequence begins.

If a selection is present when composing begins, it is preserved until
the first keypress of input is received, at which point the selection is
deleted. If a composing sequence is aborted before the first keypress,
the selection is preserved. Creating a new selection (with the mouse,
for example) aborts composing and the composing region is automatically
committed. A composing range and selection, both with an extent, are
not permitted to co-exist.

During composing, keyboard navigation via the arrow keys, or home and
end (or equivalent shortcuts) is restricted to the composing range, as
are deletions via backspace and the delete key. This patch adds two new
private convenience methods, `editing_range` and `text_range`. The
former returns the range for which editing is currently active -- the
composing range, if composing, otherwise the full range of the text. The
latter, returns a range from position 0 (inclusive) to `text_.length()`
exclusive.

* Move SetComposingLength to TextRange::set_*

Adds set_base, set_extent, set_start, set_end methods to TextRange.
2020-10-15 17:43:16 -07:00
Kaushik Iska
1bc025d6cb
[fuchsia] External view embedder will be shared with platform view (#21850) 2020-10-15 17:22:02 -07:00
Chris Bracken
fe734bdb8b
Add TextRange::Contains tests spanning base/extent (#21874)
Adds tests for TextRange::Contains(const TextRange&) where the range
being tested spans the base/extent of the testing range.

This was originally intended to land in #21854, but it seems I didn't
push the additional tests before landing.
2020-10-15 16:59:15 -07:00
Kaushik Iska
ab8b2073ed
Fix incldues to be flutter/shell rather than shell/ (#21889) 2020-10-15 16:51:17 -07:00
Adlai Holler
8ec9b3a162
Update more class names from GrContext to GrDirectContext (#21864)
This name change has to do with SkDeferredDisplayList, which Flutter
does not use. As far as Flutter is concerned, this is a no-op.
2020-10-15 16:14:23 -07:00
Jenn Magder
4494a83742
Add flag to not publish the observatory port over mDNS (#21883) 2020-10-15 14:53:20 -07:00
Jenn Magder
40c226e253
Revert "Add flag to not publish the observatory port over mDNS (#21632)" (#21882)
This reverts commit dc848f154b9c5534262e5b8d3f0360a1beafdeb5.
2020-10-15 12:32:24 -07:00
stuartmorgan
57d3c6d986
Fix destruction order in C++ plugin registrar (#21840)
The C++ wrapper's plugin registrar can own plugins to provided lifetime
management. However, plugins expect the registrar to be valid for the
life of the object, including during destruction, so any owned plugins
must be explicitly cleared before any registrar-specific destruction
happens.
2020-10-15 10:54:08 -07:00
Jenn Magder
dc848f154b
Add flag to not publish the observatory port over mDNS (#21632)
* Add flag to not publish the observatory port over mDNS

* Review edits

* Format
2020-10-15 10:48:50 -07:00
Chris Bracken
b715d3f21d
Migrate TextInputPlugin API to TextRange (#21854)
Replaces selection_base() and selection_extent() with selection() and
SetSelection(int, int) with SetSelection(range).

This also adds the following convenience methods to TextRange:
* reversed()
* Contains(size_t position)
* Contains(const TextRange& range)

as well as operator== for use in unit tests. When Flutter migrates to
C++20, we can replace that method with a default declaration.
2020-10-15 09:54:06 -07:00
gaaclarke
d2ea378be4
Revert "Explicitly make the X connection for EGL. (#21831)" (#21851)
This reverts commit 516cbaee8736cb4bbc9fdaa6af4ae9a2ec55c5cc.
2020-10-14 16:30:40 -07:00
Robert Ancell
516cbaee87
Explicitly make the X connection for EGL. (#21831)
Explicitly make the X connection for EGL.

EGL can mistakenly choose the GBM backend when using EGL_DEFAULT_DISPLAY.

Fixes https://github.com/flutter/flutter/issues/60429
2020-10-15 11:06:08 +13:00
Jason Simmons
c7e5d546f2
Prevent a race between SurfaceTexture.release and updateTexImage (#21777) 2020-10-14 15:02:02 -07:00
Kaushik Iska
df57e21529
[android] Refactor surface factory and wire in external view embedder (#21839) 2020-10-14 14:27:02 -07:00
egdaniel
d95a5dc6ad
Update flutter to pass Skia the VkImageUsageFlags and Samples (#21842)
Previously Skia did not require the clients to pass in the usage flags and Skia would just assumed they contained specific ones depending on how the client wrapped the VkImage. Now Skia allows the client to pass in the specific usage flags used so that Skia knows exactly what type of operations are legal without having to guess/assume what the client did.

Also update to set the sample count as well while I'm in here.
2020-10-14 13:55:09 -07:00
Felipe Archondo
8772365537
[fuchsia] add intercept_all_input flag support (#21821)
[fuchsia] add intercept_all_input flag support

This change also fixes an issue where FlutterRunnerProductConfiguration
crashes when a field is missing, when building with --unopt.

Test: Added unit tests
Bug: fxb/61466, fxb/61942
2020-10-13 22:11:24 -04:00
Jason Simmons
2e3f1326d2
Call PlatformView.dispose when removing hybrid composition platform views (#21790)
Also force disposal of all hybrid platform views when shutting down the
engine.

Fixes https://github.com/flutter/flutter/issues/66764
2020-10-13 18:40:55 -07:00
Kaushik Iska
279c1cffbe
[ios] Create a standalone external view embedder on iOS (#21798) 2020-10-13 17:56:31 -07:00
Emmanuel Garcia
9981026173
Allow TalkBack navigation while a platform view is rendered (#21719) 2020-10-13 17:52:02 -07:00
Dan Field
6ba6d81295
Ocmock dylib (#21786)
- Build OCMock as a dylib for iOS tests
- Set install_name for ios_flutter_test and ocmock dylibs
- Copy and sign dylibs during build process
2020-10-13 09:36:29 -07:00
Damian Wrobel
6634406889
Support Wayland only (without X11 support in gdk) (#21218)
Adds a support for compiling flutter engine when
gdk does not have X11 backend. In such a configuration
the generated gdkconfig.h header file looks like the following:

 /* gdkconfig.h
  *
  * This is a generated file.  Please modify `configure.ac'
  */

 #ifndef __GDKCONFIG_H__
 #define __GDKCONFIG_H__

 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
 #error "Only <gdk/gdk.h> can be included directly."
 #endif

 #include <glib.h>

 G_BEGIN_DECLS

 #define GDK_WINDOWING_WAYLAND

 G_END_DECLS

 #endif  /* __GDKCONFIG_H__ */

Additionally headers like <gdk/gdkx.h> are not available at all.

Above configuration can be found on the most of the embedded systems.

This patch enables compilation of X11 specific code only when gdk
defines GDK_WINDOWING_X11.

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2020-10-13 15:54:44 +13:00
J-P Nurmi
d9a24814c5
Add workaround for missing fl_method_xxx_response_get_type() symbols (#21405) 2020-10-12 19:32:02 -07:00
Yuqian Li
c2938d06b1
Revert "Migration to PlatformDispatcher and multi-window #20496" (#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit 931a04683d6eb49fc92059b2384ac5b1618d5422.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit 85b0031f73544e448354047dc6a236c0b0808252.
2020-10-12 19:26:41 -07:00
Chris Bracken
05d97932b3
Extract a TextRange class for selection (#21722)
Extracts a TextRange class with a base and extent, and start(), end(),
collapsed(), and length() getters.

The possibility of reversed base and extent in selections and composing
ranges makes reasoning about them complex and increases the chances of
errors in the code. This change migrates most uses of base and extent in
the text model to start()/end() or position(). The position() method is
intended purely as an aid to readability to indicate that a collapsed
selection is expected at the call site; it also enforces a debug-time
assertion that this is the case.
2020-10-12 17:50:11 -07:00
gaaclarke
a2046aeb6c
Revert "fix On iOS, dialog titles are announced twice (#19826)" (#21714) 2020-10-09 19:57:04 -07:00
Alexander Markov
0d151816c3
Remove uses of Dart VM bytecode mode from Flutter engine (#21741) 2020-10-09 16:34:08 -07:00