155 Commits

Author SHA1 Message Date
Robert Ancell
e17cb83726
Fix segfault if engine is disposed with an uncompleted task. (#21234) 2020-09-24 11:29:38 +12:00
Damian Wrobel
2226c2a1ec
Add missing cstring header (fixes fl_renderer_wayland.cc) (#21217) 2020-09-16 09:07:01 -07:00
William Wold
dbab3fc553
Add Linux Wayland support (#20629) 2020-09-16 14:13:06 +12:00
Damian Wrobel
21fd8917c0
Add missing <cstring> header for (strcmp, strrchr) (#21176)
Fixes the following compilation errors:
../../flutter/shell/platform/linux/fl_platform_plugin.cc:89:7: error: use of undeclared identifier 'strcmp'
  if (strcmp(format, kTextPlainFormat) != 0) {
      ^
../../flutter/shell/platform/linux/fl_platform_plugin.cc:127:7: error: use of undeclared identifier 'strcmp'
  if (strcmp(method, kSetClipboardDataMethod) == 0)
      ^
../../flutter/shell/platform/linux/fl_platform_plugin.cc:129:12: error: use of undeclared identifier 'strcmp'
  else if (strcmp(method, kGetClipboardDataMethod) == 0)
           ^
../../flutter/shell/platform/linux/fl_platform_plugin.cc:131:12: error: use of undeclared identifier 'strcmp'
  else if (strcmp(method, kSystemNavigatorPopMethod) == 0)
           ^
../../flutter/shell/platform/linux/fl_view.cc:194:7: error: use of undeclared identifier 'strcmp'
  if (strcmp(pspec->name, "scale-factor") == 0) {
      ^
../../flutter/shell/platform/linux/fl_engine.cc:67:18: error: use of undeclared identifier 'strrchr'
  gchar* match = strrchr(l, '@');
                 ^
../../flutter/shell/platform/linux/fl_engine.cc:75:11: error: use of undeclared identifier 'strrchr'
  match = strrchr(l, '.');
          ^
../../flutter/shell/platform/linux/fl_engine.cc:83:11: error: use of undeclared identifier 'strrchr'
  match = strrchr(l, '_');
          ^

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2020-09-15 08:05:12 -07:00
Greg Spencer
d19a6fab13
Track lock key down state instead of lock state (#20836)
This converts the GTK keyboard code to track the key down states of the lock modifiers NumLock and CapsLock so that they represent the actual "down" state of the key, rather than the lock state itself.

GTK tracks the lock state, and Flutter expects the down state.
2020-09-13 14:44:25 -07:00
Chris Bracken
08dabe9601
Clean up C++ includes (#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Chris Bracken
16b900b63e
Prefer C++ standard headers to their C counterpart (#21091)
We currently use a mix of C standard includes (e.g. limits.h) and their
C++ variants (e.g. climits). This migrates to a consistent style for all
cases where the C++ variants are acceptable, but leaves the C
equivalents in place where they are required, such as in the embedder
API and other headers that may be used from C.
2020-09-11 17:10:00 -07:00
Chris Bracken
fd17e0846b
Fix linter errors in mock_engine (#21102)
Make a single-param ctor explicit in order to prevent surprising
implicit conversions.

Add a check for zero message-size and don't malloc/memcpy the incoming
message in those cases.

Add braces where they were missing.
2020-09-11 10:27:00 -07:00
Damian Wrobel
e831433a20
Add missing <cstring> header (#21069)
Fixes the following compilation errors:

../../flutter/shell/platform/linux/fl_value.cc:267:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(uint8_t) * data_length);
  ^
../../flutter/shell/platform/linux/fl_value.cc:284:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(int32_t) * data_length);
  ^
../../flutter/shell/platform/linux/fl_value.cc:294:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(int64_t) * data_length);
  ^
../../flutter/shell/platform/linux/fl_value.cc:304:3: error: use of undeclared identifier 'memcpy'
  memcpy(self->values, data, sizeof(double) * data_length);
  ^

../../flutter/shell/platform/linux/fl_string_codec.cc:29:28: error: use of undeclared identifier 'strlen'
  return g_bytes_new(text, strlen(text));
                           ^

../../flutter/shell/platform/linux/fl_standard_message_codec.cc:512:23: error: use of undeclared identifier 'strlen'
      size_t length = strlen(text);
                      ^

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2020-09-10 09:24:54 -07:00
William Wold
1a034bde75
Replace FlRenderer::get_visual() with more generic FlRenderer::setup_window_attr() (#20833) 2020-08-28 14:31:34 +12:00
William Wold
dcb9244c38
Consolidate FlRenderer initialization into fl_renderer_start() (#20763) 2020-08-28 09:57:14 +12:00
Maksim Lin
57fdf0a1fb
send newline char when input type is multiline (#20660) 2020-08-25 10:51:02 -07:00
William Wold
7a022774c2
Improve FlRenderer interface in preperation for Wayland on Linux (#20006) 2020-08-05 12:04:01 +12:00
Robert Ancell
ab23dc3a74 Update code style to pass clang-tidy checks 2020-08-05 10:35:03 +12:00
Robert Ancell
083282e33b Fix Implments typo 2020-08-03 10:45:01 +12:00
Robert Ancell
8fbdd3f1bd Fix parameter names 2020-08-03 10:44:20 +12:00
Siva
b955e15ee9
Manual roll of Dart from 24c7666def...40fd1c456e (#20092)
* Manual roll of Dart from 24c7666def...40fd1c456e

dart-lang/sdk@40fd1c456e Revert "[dart:io] Add Abort() on HttpClientRequest"
dart-lang/sdk@17d7296a42 [vm/nnbd/bytecode] Fix reuse of type arguments in bytecode
dart-lang/sdk@58b6f40c73 Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns. (reland)
dart-lang/sdk@fc8a6d9f9b [VM/compiler] Dereference TypeRef literal when propagating constants.
dart-lang/sdk@0689ec527a Move "test.dart" (well, most of its contents) into pkg/test_runner.
dart-lang/sdk@1094b3c61d Prepare static error test updater tool to handle web tests.
dart-lang/sdk@b258585f2f [observatory] Migrate from deprecated isInstanceOf to isA.
dart-lang/sdk@dfe1d9b682 Disable OverrideContributor for Cider.
dart-lang/sdk@aea99b2f5c scope debug property assist to Diagnosticables
dart-lang/sdk@4b96f20a79 [dart:io] Add Abort() on HttpClientRequest
dart-lang/sdk@1b1a39708c [build] Use frameworks instead of libs
dart-lang/sdk@3fef522496 Revert "Reland "[vm] Replaces fuchsia.deprecatedtimezone""
dart-lang/sdk@8c664d4f3f Revert "Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns."
dart-lang/sdk@2efb5bebc7 [ dart:_http ] Fix typo in HTTP response timeline event
dart-lang/sdk@0884dae36c Revert "Fix the #include path for ICU headers"
dart-lang/sdk@5171534e81 Scope tweaks. Report REFERENCED_BEFORE_DECLARATION in more places.
dart-lang/sdk@6bba75079a Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns.
dart-lang/sdk@b4ebbb7f5c [build] Update gn to match Fuchsia
dart-lang/sdk@cb428a7a02 [dart2js] Remove old bug work around in collector.
dart-lang/sdk@08663c20ab Change flutter patch to match existing DEPS on master branch
dart-lang/sdk@146ad014d9 update js/meta for the 2.10 dev sdk
dart-lang/sdk@488c718793 [co19] Roll co19 to d79951e06e443213243e54c2c32694b79a221b65
dart-lang/sdk@ba20edd7be Add patch for flutter-engine when changing to version 2.10

* Rev buildroot to latest version.

* Update license.

* update.

* Update gn revision.

* Format BUILD.gn files as the gn revision has been updated.
2020-07-29 13:10:15 -07:00
stuartmorgan
29f63349c8
Fix invalid selection handling in text plugins (#19899)
The Windows, Linux, and GLFW embeddings (which all share a common code
ancestry) pass TextInput.setEditingState selection base and extents
straight through to the shared text model class. The model expects those
values to be valid, but the framework sends -1/-1 for "invalid"
selections, which happen for some empty text cases (e.g.,
TextFieldController.clear()).

This translates those invalid selection values to an empty selection at
the start of the string, as expected by the model.

Fixes https://github.com/flutter/flutter/issues/59140
2020-07-27 11:00:02 -07:00
William Wold
4f647efd91 Change FlView::renderer from X11-specific to generic 2020-07-22 11:17:38 +12:00
William Wold
57b6d9e5c7 Call eglGetError() before other EGL calls that will wipe it 2020-07-22 11:17:38 +12:00
Tong Mu
fbef051f5c
Add all system cursors (engine) (#19550)
* Support all system cursors in WIn, Linux, mac, Web and Android.
2020-07-15 15:37:18 -07:00
Tong Mu
7a95e32fc5
Linux: Use a hash table to map cursors (#19561)
Refactors the process of looking up system mouse cursor value, so that instead of a linear search it uses a hash table.
2020-07-13 13:32:13 -07:00
Robert Ancell
f3ab78dc1f
Fix clipboard paste functionality not working (#19489) 2020-07-10 11:34:23 +12:00
Robert Ancell
160b268ef1
Set locale in Linux shell (#19470) 2020-07-10 11:16:50 +12:00
Robert Ancell
acd026ed3f
Use the X visual from the EGL configuration when making an FlView. (#19438) 2020-07-03 09:37:51 +12:00
Robert Ancell
480afb30ad
Show EGL configuration debugging when fail to create surface/context (#19397) 2020-07-02 09:35:00 +12:00
Robert Ancell
fcdc1dbc36
Replace GLFW key codes with native Flutter GTK support (#19196)
Fixes https://github.com/flutter/flutter/issues/57603
2020-06-26 13:56:18 +12:00
Robert Ancell
f267ef5837
Add a flag to enable dart:mirrors (#19112)
Fixes https://github.com/flutter/flutter/issues/59233
2020-06-26 11:17:15 +12:00
Robert Ancell
01e06ed3d9
Add support for headless mode (#19038) 2020-06-17 06:25:48 +12:00
Robert Ancell
9f898e98c2
Don't process key events when the text input is not requested (#18990) 2020-06-12 10:59:35 +12:00
Robert Ancell
4bd6aea07c
Always send key events, even if they're used for text input. (#18991) 2020-06-12 10:59:23 +12:00
Robert Ancell
87d8888048
Show warning if method response errors occur and error not handled. (#18946) 2020-06-12 09:11:36 +12:00
Robert Ancell
5ddc122f02
Fix inverted check in creating resource surface (#18989) 2020-06-12 09:09:06 +12:00
Robert Ancell
71fce02dd6
Fix shift-tab not working by adding more GTK->GLFW key mappings. (#18988) 2020-06-12 09:08:41 +12:00
Robert Ancell
ca26b7558e
Make Linux shell plugin constructor descriptions consistent (#18940) 2020-06-11 12:31:29 +12:00
Robert Ancell
b19a17d5d1
Implement an EGL resource context for the Linux shell. (#18918)
Fixes https://github.com/flutter/flutter/issues/54855
2020-06-11 12:31:06 +12:00
Robert Ancell
101e85491d
Add FlMouseCursorPlugin (#18888)
Fixes https://github.com/flutter/flutter/issues/57595
2020-06-10 14:16:42 +12:00
Robert Ancell
283cc2a536
Add FlPlatformPlugin (#18316)
Fixes https://github.com/flutter/flutter/issues/54857
2020-06-10 12:02:24 +12:00
Robert Ancell
6f5d92d241
Remove the input type and action from TextInputModel. (#18919)
These aren't used by the model so are better managed outside of it.
2020-06-10 10:00:32 +12:00
Robert Ancell
0c7f4c7a18
Log EGL errors (#18917) 2020-06-10 06:27:30 +12:00
Robert Ancell
db6793bca3
Use constant for error code (#18913) 2020-06-10 06:27:08 +12:00
Robert Ancell
91d520986e
Add scroll event support (#18885) 2020-06-09 12:20:06 +12:00
Robert Ancell
320e80552f
Update FlTextInputPlugin method handler style. (#18886)
Match the style used in the external plugins and more carefully vet the incoming
arguments.
2020-06-09 11:36:00 +12:00
Robert Ancell
b0eee7675f
Support window scaling (#18891) 2020-06-09 11:08:42 +12:00
Robert Ancell
6fd3356715
Fix name of Flutter class in plugin docstrings (#18889) 2020-06-09 11:05:19 +12:00
Robert Ancell
dfdd88deb7
Support AOT mode in GTK shell (#18809)
Simplify FlDartProject by removing the path arguments - we'll assume that it's
in the standard bundle layout and add new methods later if we need to support
other cases.
2020-06-08 13:18:52 +12:00
Robert Ancell
a25d851edf
Don't call engine when not initialized. (#18810)
This stops events and platform messages generating errors when the engine has
failed to initialize.
2020-06-05 13:27:56 +12:00
Robert Ancell
8d97830992
Fix braces style (#18837) 2020-06-05 13:26:54 +12:00
Robert Ancell
6e378cf669
Mark symbols that should be public (#18802) 2020-06-04 14:31:35 +12:00
stuartmorgan
a95882ba70
Don't export embedder API in desktop embeddings (#18735)
The embedder.h API layer is an implementation detail of the desktop
embeddings, not part of the public API surface, so should not be part of
the public symbol list for those libraries.
2020-06-03 18:13:59 -07:00