4098 Commits

Author SHA1 Message Date
Tong Mu
16d5aa1e7d [macOS, Keyboard] Convert abrupt repeat events to down events (flutter/engine#31941)
* Impl and test

* Format
2022-03-09 23:13:12 -08:00
Justin McCandless
53425594be Bugfix: linux deltas should use selection here, not composing (flutter/engine#31906)
Fix for TextEditingDeltas composing case.
2022-03-09 13:25:02 -08:00
godofredoc
517844bc57 Generate MacOS framework with GN + Ninja. (flutter/engine#31903) 2022-03-09 12:45:04 -08:00
utzcoz
7db830289d Use config to set land qualifiers (flutter/engine#31853)
Signed-off-by: utzcoz <utzcoz@outlook.com>
2022-03-09 08:00:49 -08:00
ColdPaleLight
611a350575 Use AChoreographer methods to await vsync when available (flutter/engine#31859) 2022-03-08 21:15:08 -08:00
Tong Mu
809d01034b [Win32, Keyboard] Fix AltGr's forged ControlLeft (flutter/engine#31848) 2022-03-08 18:20:03 -08:00
Rutger Vromans
8c42b89cdf Access on/off labels accessibility setting for switches on iOS (flutter/engine#30764) 2022-03-07 14:51:10 -08:00
Jonah Williams
257234a32a Allow providing max_cache_entry flag to Dart (flutter/engine#31881) 2022-03-07 14:21:02 -08:00
Chris Bracken
76d4487cc9 [macOS] Clear IME mark text on clear input client (flutter/engine#31849)
When the embedder receives a TextInput.clearClient message from the
framework (typically when a text field loses focus), if the user is
currently inputting composing text using an IME, commit the composing
text, end composing, and clear the IME's composing state.

This also exposes a public `editingState` getter on
FlutterTextInputPlugin as part of the TestMethods informal protocol.
This allows us to get at the text editing state as a dictionary in
tests.

Issue: https://github.com/flutter/flutter/issues/92060
2022-03-07 10:30:46 -08:00
Jonah Williams
4f31c558bc [windows] use angle fast path on d3d11 backend (flutter/engine#31830) 2022-03-07 10:06:09 -08:00
Rulong Chen(陈汝龙)
4f6f461dac Fix compatibility issues with SurfaceTexture on Android Q. (flutter/engine#31698) 2022-03-07 10:01:26 -08:00
Chris Bracken
4f4fcb224e [macos] Register log handler (flutter/engine#31861)
Previously, the macOS embedder relied on the deprecated built-in log
handling in lib/ui/ui_dart_state.cc. Instead, we now register a
dedicated log handler for the macOS embedder. This is used, for example,
to output Dart 'print' calls.

While unlikely that we'll break the internal generic fallback logging,
it's preferable to keep platform-specific functionality in the embedder.

Issue: https://github.com/flutter/flutter/issues/99636
2022-03-06 12:31:29 -08:00
Justin McCandless
b7f187c7d2 TextEditingDelta Windows (flutter/engine#30329)
Support for TextEditingDeltas (useful for rich text editors) on Windows.
2022-03-04 13:31:06 -08:00
Chris Bracken
8335c02fd1 [Linux] Fix CJK input (flutter/engine#31813)
Fixes an issue with CJK IMEs wherein a text input state update may be
sent to the framework that misleads the framework into assuming that IME
composing has ended.

As an example, when inputting Korean text, characters are built up keystroke by
keystroke until the point that either:

* the user presses space/enter to terminate composing and commit the
  character, or;
* the user presses a key such that the character currently being
  composed cannot be modified further, and the IME determines that the
  user has begun composing the next character.

The following is an example sequence of events for the latter case:

1. User presses ㅂ. Begin compose event followed by change event
   received with ㅂ. Embedder sends state update to framework.
2. User presses ㅏ. im_preedit_changed_cb with 바. Embedder sends state
   update to framework.
3. User presses ㄴ. im_preedit_changed_cb with 반.  Embedder sends state
   update to framework.
4. User presses ㅏ. At this point, the current character being composed
   (반) cannot be modified in a meaningful way, and the IME determines
   that the user is typing 바 followed by 나. im_commit_cb received with
   바, immediately followed by im_preedit_changed event with 나.

In step 4, we previously sent two events to the framework, one
immediately after the other:

* im_commit_cb triggers the text input model to commit the current
  composing region to the string under edit. This causes the composing
  region to collapse to an empty range.
* im_preedit_change_cb triggers the text input model to insert the new
  composing character and set the composing region to that character.

Conceptually, this is an atomic operation. The fourth keystroke causes
the 반 character to be broken into two (바 and ㄴ) and the latter to be
modified to 나. From the user's point of view, as well as from the IME's
point of view, the user has NOT stopped composing, and the composing
region has simply moved on to the next character.

Flutter has no concept of whether the user is composing or not other
that whether a non-empty composing region exists. As such, sending a
state update after the commit event misleads the framework into
believing that composing has ended. This triggers a serious bug:

Text fields with input formatters applied do not perform input
formatting updates while composing is active; instead they wait until
composing has ended to apply any formatting. The previous behaviour
would thus trigger input formatters to be applied each time the user
input caused a new character to be input. This has the add-on negative
effect that once formatting has been applied, it sends an update back to
the embedder so that the native OS text input state can be updated.
However, since the commit event is immediately followed by a
preedit change, the state has changed in the meantime, and the embedder
is left processing an update (the intermediate state sent after the
commit) which is now out of date (i.e. missing the new state from the
change event).

The source of this bug is as follows:
* Commit event for a character/compose region is sent from the engine.
  The engine TextInputModel still models its `composing` field as true.
  An update is sent to the framework with the committed text and an
  empty composing range such as (1, 1). Note that the engine previously
  only sends a range of (-1, -1) when composing has ended, NOT just when
  it has an empty composing region.
* Framework receives commit event and updates the text to match. The
  framework does not model the system composing state; instead its
  understanding of whether the user is composing or not is entirely
  predicated on whether the composing region is empty or not. If it is,
  it triggers input formatters, which in this case have no effect on the
  text/selection. However, the framework consistently models empty
  compose regions as (-1, -1) and resets the text editing value as such.
  Because the framework triggered a change to the TextEditingValue, it
  dutifully sends the update back to the engine.
* In the meantime, in parallel with the above step, the engine starts
  processing the change event immediately following the commit, and
  updates the text and composing region with the next character. This
  change is promptly stomped on by the incoming framework update.

To avoid this, we have the engine consistently send empty compose
regions as (-1, -1) to the framework. After the input formatter is
applied on commit, the compose region is still (-1, -1) and there are
therefore no diffs, and the framework will not send an update back to
the engine and stomp on any new state on the engine side.

Longer-term, we really should add some form of versioning information to
the text edit protocol so as to detect and resolve conflicts rather than
relying entirely on not creating races in the first place.

This bug was revealed by flutter/flutter#90211
which applies an input formatter to single-line text fields in order to
suppress newlines.

Issue: flutter/flutter#97174
2022-03-04 11:39:26 -08:00
Daco Harkes
4c2fccfc57 Add VM Finalizer patch files (flutter/engine#31825) 2022-03-04 13:47:56 +01:00
chunhtai
3037b0b6a5 iOS removes children references when semantics node is replaced (flutter/engine#31810) 2022-03-03 22:01:07 -08:00
Tong Mu
2ed741ac83 [macOS, Keyboard] Duplicate down events are no longer ignored, but kept and preceded by up events (flutter/engine#31800) 2022-03-03 21:31:12 -08:00
Jonah Williams
643b1cd598 Add support for setting thread priority in embedder.h and update windows embedding to do so (flutter/engine#31778) 2022-03-03 21:21:03 -08:00
Niklas Schulze
caf008b9f6 Windows: Fix plugin destruction (flutter/engine#30760) 2022-03-03 13:16:11 -08:00
Rulong Chen(陈汝龙)
1e2f796278 [android] Give the shared engine app a chance to take control of application lifecycle state events. (flutter/engine#30208) 2022-03-03 13:06:11 -08:00
Jonah Williams
75f0c30722 [win32] support high frame rates (flutter/engine#28927) 2022-03-03 12:06:06 -08:00
Jesús S Guerrero
a9dc88faa7 Support route on ios engine (flutter/engine#31555) 2022-03-02 13:26:02 -08:00
JsouLiang
f88b49b778 Add ThreadConfigSetter for Embedder api that can set thread priority (flutter/engine#31626) 2022-03-01 16:23:24 -08:00
Jason Simmons
da146d247c Revert "Reland "Listen for Vsync callback on the UI thread directly"" (flutter/engine#31750) 2022-03-01 15:06:11 -08:00
godofredoc
29c2897bfb Standardize embedder archive name. (flutter/engine#31693) 2022-02-28 21:26:09 -08:00
godofredoc
7bfe815f56 Standardize the embedder file name. (flutter/engine#31723) 2022-02-28 16:31:06 -08:00
Justin McCandless
807287ff34 Fix copy/paste when scribble enabled (flutter/engine#31691)
Fixes cmd+c and cmd+v on iPad scribble-enabled devices.
2022-02-28 13:36:14 -08:00
Camille Simon
29d3cc56ed Undo Deletion in #31092 (flutter/engine#31661) 2022-02-28 09:31:02 -08:00
Jason Simmons
423d3655dc Revert "Change FlutterViewController default opaque value to NO (#30664)" (flutter/engine#31710) 2022-02-27 19:41:02 -08:00
Emmanuel Garcia
32f6e78828 Fix nullable annotation (flutter/engine#31668) 2022-02-25 11:46:11 -08:00
godofredoc
64edff106a Generate linux gtk zip in the correct folder. (flutter/engine#31650) 2022-02-24 10:41:02 -08:00
ColdPaleLight
1a179ecff2 Reland "Listen for Vsync callback on the UI thread directly" (flutter/engine#31494) 2022-02-24 09:51:05 -08:00
ColdPaleLight
c715418c4b Don't call 'ExternalViewEmbedder::EndFrame' when pipeline is empty (flutter/engine#31546) 2022-02-23 15:56:34 -08:00
Rulong Chen(陈汝龙)
2ccc8c1af6 Using invalidateChildInParent for API levels lower than 26. (flutter/engine#31533) 2022-02-22 21:49:02 -08:00
JsouLiang
450e986dd0 Change FlutterViewController default opaque value to NO (flutter/engine#30664) 2022-02-20 19:22:15 -08:00
Emmanuel Garcia
0eb5a3774a Reland: Fix first batch of warnings in the Android embedding (flutter/engine#31530) 2022-02-18 11:39:07 -08:00
Callum Moffat
a43a417f9c Add missing trackpad enum to android and web (flutter/engine#31429) 2022-02-17 14:01:31 -08:00
Camille Simon
58ed84f8cd [Android] Show all deprecation warnings for tests (flutter/engine#31455) 2022-02-17 13:34:11 -08:00
ColdPaleLight
043d9d2e39 Add an embedder.h API for scheduling frame (flutter/engine#31304) 2022-02-17 13:24:10 -08:00
m-bialek
266fc0e6d4 Initialize members and check for nullptr (flutter/engine#30941) 2022-02-17 13:04:02 -08:00
Camille Simon
fc7b6647b5 Partially remove setSystemUiVisibility() usages (flutter/engine#31092) 2022-02-17 12:54:02 -08:00
Emmanuel Garcia
d1d733c608 Conditionally call FlutterViewDestroyOverlaySurfaces (flutter/engine#31464) 2022-02-17 12:19:02 -08:00
Emircan Uysaler
23f0ae0a7c [fuchsia] Update flatland TODO bug numbers (flutter/engine#31504) 2022-02-17 10:31:45 -08:00
Tong Mu
33ef133aa8 [Win32, Keyboard] Resume redispatching ShiftRight key down and DeadKey messages (flutter/engine#31459)
* Tests

* KeyStateChange

* Format

* InjectKeyboardChanges

* Migrate KeyStateChange

* Revert comment changes

* protected queue

* Remove assert

* Move InjectKeyboardChanges to window

* Rename to kKeyStateChange

* Split MockMessageQueue messages. Remove WMsg.hWnd

Fix embedder test

Implement and finish tests

* Format

* Better doc

* Impl

* KeyUp overwrite_prev_state_0

* Tests

* Remove ShiftRight check and check redis count.

RedispatchedMessageCountAndClear

Add more tests. Problem with `handled` patching.

Remove ComputeEventHash

* Fix compile

* Move sys filter. Remove dead key filter.

* Complete tests

* Comment

* Remove unnecessary changes
2022-02-15 21:49:13 -08:00
Tong Mu
d031902ac3 [Win32, Keyboard] Process VK_PACKET; Unprintable keys block text (flutter/engine#31379)
* Tests

* KeyStateChange

* Format

* InjectKeyboardChanges

* Migrate KeyStateChange

* Revert comment changes

* protected queue

* Remove assert

* Move InjectKeyboardChanges to window

* Rename to kKeyStateChange

* Split MockMessageQueue messages. Remove WMsg.hWnd

Fix embedder test

Implement and finish tests

* Format

* Better doc

* Impl

* KeyUp overwrite_prev_state_0

* Tests

* Comment

* Fix compile

* Format

* Remove unnecessary changes

* Remove outdated comment

* Add redispatching count

* Format
2022-02-15 17:45:36 -08:00
Tong Mu
8eb1f58c24 [Win32, Keyboard] Check the states of all modifiers (flutter/engine#31297) 2022-02-15 16:00:11 -08:00
Emmanuel Garcia
c42f5c3591 Reland "Improve platform views performance" (flutter/engine#31468) 2022-02-15 10:25:10 -08:00
Tong Mu
1aca7024d9 [Win32, Keyboard] Check redispatch count in keyboard tests (flutter/engine#31462) 2022-02-14 17:25:10 -08:00
Tong Mu
6370d313bb [Win32, Keyboard] Unify key changes in keyboard tests (flutter/engine#31299) 2022-02-14 15:40:11 -08:00
Zachary Anderson
7990f3dee5 Revert "Improve platform views performance (#31198)" (flutter/engine#31431)
This reverts commit 9ee76a65723d1d75af55ba8a58b70b8bef7a6536.
2022-02-12 16:22:58 -08:00