Robert Ancell
231d3466cc
Return result of setting OpenGL contexts back to Flutter ( #173757 )
...
Also check when using them internally that they have worked.
2025-08-14 21:00:50 +00:00
Robert Ancell
53676f000b
Fix GTK redraw call being called from non-GTK thread. ( #173602 )
...
gtk_widget_queue_draw is not thread-safe, call it from an idle callback.
Fixes https://github.com/flutter/flutter/issues/173447
2025-08-12 22:56:19 +00:00
Jason Simmons
f45a8f8b71
Roll Clang to 8c7a2ce01a77c96028fe2c8566f65c45ad9408d3 ( #173429 )
...
This version is currently used by Dart.
2025-08-12 17:21:53 +00:00
gaaclarke
a374668798
licenses_cpp: moved is_minimal_linux to pkgconfig usage ( #173248 )
...
addresses feedback from
https://github.com/flutter/flutter/pull/173139#pullrequestreview-3080740288
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-08-05 23:06:14 +00:00
gaaclarke
bd542bb687
licenses_cpp: reland switch 4 ( #173139 )
...
Let's give this one more go, otherwise we'll have to switch to
downloading a prebuilt binary.
## whats new since revert
I've added `is_minimal_linux` flag which removes targets that can't be
processed by GN on the autoroller image. The linux bot has been changed
to use that flag too.
## testing
I got access to the docker image of the autoroller bots and manually
tested that this works.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-04 17:37:29 +00:00
Robert Ancell
afba7d75b3
Remove GtkGLArea and render directly into GtkDrawingArea ( #172343 )
...
This simplifies the OpenGL/software case and allows us more control over
the buffering.
2025-07-23 02:04:50 +00:00
Robert Ancell
407c051ec9
Render Flutter in its own EGL context ( #172330 )
...
This allows Flutter to render without any GTK windows present (required
for multi-window)
2025-07-21 21:59:37 +00:00
Robert Ancell
a5c93c90a1
Refactor handling of frame waiting. ( #172277 )
...
Compositing is now done on the Flutter rendering thread and we block the
GTK rendering until the frame is generated. This no longer requires the
task runner to be involved.
2025-07-18 00:55:40 +00:00
Robert Ancell
e983e59620
Perform OpenGL compositing in the Flutter thread and write to a framebuffer. ( #172090 )
...
This framebuffer then gets copied into GTK during the draw calls. This
disconnects the Flutter rendering from the GTK rendering which will
allow us to render Flutter using EGL directly and support rendering
without any views present (required for multi-window).
Framebuffers are shared between the Flutter and GTK OpenGL contexts
using EGLImage. When running under X11 GTK uses GLX and this is not
possible - instead the buffers are copied via the CPU in this case.
2025-07-17 00:09:53 +00:00
Robert Ancell
78e111f5a0
Refactor compositor classes ( #171414 )
...
Present frames directly to each view, which maintains its own
compositor.
This simplifies the compositor so it doesn't need to maintain a map from
views to buffers.
2025-07-10 02:55:07 +00:00
Robert Ancell
d1295bdc63
Fix multi-view GL rendering not working since software rendering was added ( #171409 )
...
Software rendering was added in
a79827a310572585df7b39a29f13de0a313d6d40.
It accidentally removed the different GL initialization for secondary
views (which need to copy the contents from the primary view). This is
not a heavily used feature yet, as multi-window support is still in
progress. This secondary codepath is in the process of being removed by
https://github.com/flutter/flutter/pull/170045
2025-07-09 01:35:03 +00:00
Alex Medinsh
ee23d89857
Add CupertinoPicker ticking sound ( #170641 )
...
This PR adds a ticking sound to the `CupertinoPicker` on iOS.
Fixes https://github.com/flutter/flutter/issues/37329
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-06-30 17:54:07 +00:00
Robert Ancell
8d5d0e21e9
Clear background in the GTK layer, instead of OpenGL ( #170840 )
...
Since OpenGL was being blitted, it would overwrite the color set with
clear color anyway. Also fix the software rendering case that was not
setting any background.
This could cause a black screen to show by default, if you want the
previous behaviour set the view background to transparent with:
```
GdkRGBA background_color;
gdk_rgba_parse(&background_color, "#00000000 ");
fl_view_set_background_color(view, &background_color);
```
---------
Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
2025-06-22 23:55:25 +00:00
Robert Ancell
d4ab90823e
Use a shared vertex buffer for rendering layers. ( #170717 )
...
Only generate the vertex buffer once, and use uniforms to translate and
scale it in the vertex shader.
We still need to generate the vertex for each view, which seems
unnecessary but it cannot be shared across contexts in OpenGL. This
should be tackled in a future change.
2025-06-18 23:14:11 +00:00
Robert Ancell
117c60edcf
Update Linux embedder to new semantics flags API ( #170497 )
...
As changed in https://github.com/flutter/flutter/pull/167738 .
2025-06-17 04:01:19 +00:00
Hannah Jin
978ef6b820
Reland ( #167738 ) but with some flags updated to use enum ( #170505 )
...
Reland (#167738 ) : [a11y] Semantics flag refactor step 2: embedder part
*with some updates*
The original PR was reverted because the changes to embedder should be
in one PR to avoid introducing breaking changes.
This PR contains 2 commits, one commit of re-landing #167738 and one
commit of new enum updates.
new Updates :
Add new enum FlutterTristate and FlutterCheckState in embedder.h for 7
flags.
For CheckState, it used to use 3 bools (hasCheck, isChecked,
isCheckStateMixed) to represent check states, replace them with a
FlutterCheckState enum.
For other 6 flags, each has 2 bools (hasXXState and isXX), replace them
with a FlutterTristate enum.
TODO:
Will also update these flags in dart:ui and framework to be tristate too
in another PR, this PR is only for embedder.
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Chris Bracken <chris@bracken.jp>
Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2025-06-13 04:46:28 +00:00
Hannah Jin
a534b21380
Revert "[a11y] Semantics flag refactor step 2: embedder part" ( #170498 )
...
Reverts flutter/flutter#167738
Reason: I want to make more changes on embedder so some semantics flags
will be tristate. To avoid introducing breaking changes, revert the
former PR
2025-06-12 03:37:56 +00:00
Hannah Jin
cb01defdcf
[a11y] Semantics flag refactor step 2: embedder part ( #167738 )
...
issue: https://github.com/flutter/flutter/issues/166101 , overall goal is
to update semantics flag to be a struct/class to support more than 32
flags.
step 1: https://github.com/flutter/flutter/pull/167421 updated
semantics_node.h and dart:ui
step 2(this PR): Update Embedder part to use a struct instead of a int
bit mask.
step 3: https://github.com/flutter/flutter/pull/167771 Update Framework
use the SemanticsFlags class instead of bitmask
step 4 https://github.com/flutter/flutter/pull/168852 Update web engine
to use the new class and update SemanticsUpdateBuilder.updateNode to
pass the new class instead of bitmask
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Chris Bracken <chris@bracken.jp>
Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2025-06-10 18:11:07 +00:00
richardexfo
5c4edc244f
Fix Linux OpenGL compositor on ARM driver ( #166753 )
...
Fix Linux OpenGL compositor on ARM driver.
Add "ARM" to the list of drivers unsupported by the gl_framebuffer_blit
based rendering.
https://github.com/flutter/flutter/issues/152099
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Robert Ancell <robert.ancell@canonical.com>
2025-06-03 00:20:08 +00:00
Robert Ancell
a79827a310
Support software rendering on Linux ( #166307 )
...
This can be enabled by setting the environment variable
FLUTTER_LINUX_RENDERER=software.
The purpose is to be able to test Flutter OpenGL Linux issues by running
you app in this mode. In the future this could be enhanced to
automatically switch to software if OpenGL support is not available.
Fixes https://github.com/flutter/flutter/issues/151389
2025-06-02 22:34:08 +00:00
Robert Ancell
0b9f9288ca
Fix Linux Impeller support broken by incorrect deletion of stencil buffer. ( #168668 )
...
The buffer was leaking and deleted in
9d8e5e0b2f0dbff358286a1f83c83e65077d0b7a. This fixes the location where
the buffer is deleted.
2025-05-14 08:31:16 +00:00
Robert Ancell
9d8e5e0b2f
Fix stencil buffer leak ( #168448 )
...
Most noticable when rendering to secondary views, one leak per frame.
Introduced for Impeller in 3af706d1887a26410cb82a9aa61da6c773d132f2
2025-05-07 17:57:08 +00:00
Robert Ancell
b3f6925fda
Fix framebuffer leak rendering to secondary views. ( #168447 )
...
Each frame would be leaked. This doesn't occur for single window.
2025-05-07 17:56:28 +00:00
Robert Ancell
f9fb8906c7
Fix uninitalized fields in FlutterWindowMetricsEvent ( #168446 )
...
Specifically physical_view_* were not set and thus had random values.
When they were negative this would cause Flutter to reject the event.
2025-05-07 17:55:45 +00:00
Matej Knopp
fffe394cdd
[Linux] Merge UI And Platform thread ( #162671 )
...
Disabled by default, to enable use
`fl_dart_project_get_ui_thread_policy`:
```cpp
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_ui_thread_policy(project, FL_UI_THREAD_POLICY_RUN_ON_PLATFORM_THREAD);
```
With this PR, the UI isolate now runs on platform thread, which allows
for synchronous calls to Gtk, as well as synchronous calls from Gtk to
Flutter. For example something like this is now possible:
```dart
typedef GtkWindow = Pointer<Void>;
void setWindowPosition() {
final library = DynamicLibrary.executable();
// Hypothetical function to get pointer to GtkWindow
final getMainWindow = library
.lookupFunction<GtkWindow Function(), GtkWindow Function()>(
'get_main_window',
);
final gtkWindowResize = library.lookupFunction<
Void Function(GtkWindow, Int32, Int32),
void Function(GtkWindow, int, int)
>('gtk_window_resize');
final window = getMainWindow();
gtkWindowResize(window, 200, 200);
}
```
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-30 08:53:09 +00:00
Robert Ancell
be79e0a0a6
Rename FlRenderer to FlCompositorOpenGL ( #166037 )
...
Matches the Flutter engine compositor and is similar to the Windows
embedder classes.
2025-04-01 04:04:08 +00:00
Robert Ancell
bfe95d3819
Move OpenGL context management to FlOpenGLManager ( #166025 )
...
This helps to make a non-OpenGL FlRenderer
2025-03-28 00:37:05 +00:00
Robert Ancell
b39232e610
Move tracking of renderables from FlRenderer to FlEngine ( #165848 )
...
Motivated by work on refactoring FlRenderer to FlCompositor.
2025-03-26 03:24:36 +00:00
Robert Ancell
9b0c5c6c1c
Fix regression in semantics update handling. ( #165842 )
...
This was shown with the following errors in stdout:
GLib-GObject-CRITICAL **: 11:41:35.775: invalid cast from 'FlEngine' to
'FlView'
This was broken in 554c814ada6419c4ece39a8de5ff38e16cda614b
2025-03-26 00:50:17 +00:00
Jason Simmons
08d2703016
Roll libcxx to bd557f6f ( #165621 )
...
Changes required for this roll:
* addition of LLVM libc (which is now a dependency of libcxx)
* updates the to license script
* patching the verify_exported check to allow some symbols added by
libcxx
* annotations for clang-tidy warnings
2025-03-24 15:39:26 +00:00
Matthew Kosarek
554c814ada
( #112207 ) Adding view_id parameter to DispatchSemanticsAction and UpdateSemantics ( #164577 )
...
fixes #112207
## What's new?
- Added a `view_id` on `UpdateSemantics`
- Added a `view_id` on `DispatchSemanticsAction`
- Piped the `view_id` all over creation
- Updated tests for these actions across the different platforms
- Added `FlutterEngineSendSemanticsAction` to the embedder API in order
to not break `FlutterEngineDispatchSemanticsAction`
- Using this view ID properly on the Windows platform (see
`engine/src/flutter/shell/platform/windows/flutter_windows_engine.cc`)
## How to test
1. Checkout
[foundation-plus-framework](https://github.com/canonical/flutter/pull/36 )
from canonical/flutter
2. Merge this branch into it
3. Enable the "Narrator" screen reader on windows
4. Run the Multi window reference app (see
[PR](https://github.com/canonical/flutter/pull/36 ) for details)
5. Open up another window, and note that the right buttons and things
are being highlighted, as the screenreader would expect 🎉
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-03-20 16:30:07 +00:00
Robert Ancell
39dc5717d5
Consolidate GTK mocks ( #164890 )
...
This was split across three files, consolidate into one.
---------
Co-authored-by: Harlen Batagelo <hbatagelo@gmail.com>
2025-03-11 15:30:09 +00:00
Matej Knopp
92fdf29e6f
[Linux] Move rendering to raster thread ( #161879 )
...
Fixes https://github.com/flutter/flutter/issues/155045
*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Robert Ancell <robert.ancell@canonical.com>
2025-03-11 09:30:03 +00:00
Robert Ancell
3b884b0871
Don't process cursor changes until view is realized. ( #164349 )
...
For views created with fl_view_new_for_engine() the cursor processing
was subscribed to before the window had realized. This caused the
following warnings on startup:
[+3105 ms] (com.example.flutter_multi_view_test:619234): Gdk-CRITICAL
**: 13:00:35.501: gdk_window_get_display: assertion 'GDK_IS_WINDOW
(window)' failed
[ ] (com.example.flutter_multi_view_test:619234): Gdk-CRITICAL **:
13:00:35.501: gdk_cursor_new_from_name: assertion 'GDK_IS_DISPLAY
(display)' failed
[ ] (com.example.flutter_multi_view_test:619234): Gdk-CRITICAL **:
13:00:35.501: gdk_window_set_cursor: assertion 'GDK_IS_WINDOW (window)'
failed
Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
2025-03-04 15:37:02 +00:00
Matej Knopp
b831b269c5
Add PlatformDispatcher.engineId ( #163476 )
...
Fixes https://github.com/flutter/flutter/issues/163430 .
This PR adds `engineId` field to `PlatformDispatcher`. When provided by
the engine, this can be used to retrieve the engine instance from native
code.
Dart code:
```dart
final identifier = PlatformDispatcher.instance.engineId!;
```
macOS, iOS:
```objc
FlutterEngine *engine = [FlutterEngine engineForIdentifier: identifier];
```
Android:
```java
FlutterEngine engine = FlutterEngine.engineForId(identifier);
```
Linux
```cpp
FlEngine *engine = fl_engine_for_id(identifier);
```
Windows
```cpp
FlutterDesktopEngineRef engine = FlutterDesktopEngineForId(identifier);
```
*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-28 22:20:11 +00:00
Robert Ancell
933cb5da82
Support forward and back buttons ( #164356 )
...
Based on https://github.com/flutter/flutter/pull/163500 by @2bndy5
2025-02-28 14:28:47 +00:00
Robert Ancell
25b3a4743a
Fix window creation callback for multi-window ( #164353 )
...
The windowing handler wasn't being created early enough and the view
wasn't visibile by default.
2025-02-28 13:41:10 +00:00
Robert Ancell
407065ea20
Replace update semantics handler with signal. ( #163583 )
...
The previous code was built where there was only one view, and this view
provided the callback to the engine.
Now we have multiple views, they all should process the semantics update
and so the callback is replaced with a signal. This is similar to the
signal used for engine restarts.
---------
Co-authored-by: Harlen Batagelo <hbatagelo@gmail.com>
2025-02-27 23:30:53 +00:00
Robert Ancell
d8a57c61dd
Add windowing channel support to Linux embedder ( #163180 )
...
Implement flutter/windowing for the Linux embedder.
2025-02-27 04:14:20 +00:00
Robert Ancell
5365993ff5
Replace hard coded numbers with mouse button defines ( #163503 )
...
No behaviour change, just for clarity.
2025-02-18 14:36:46 +00:00
Robert Ancell
4cc9db4125
Move FlTextInputHandler from FlView ( #162131 )
...
This moves the final part of the keyboard handling from FlView to the
FlEngine and means keyboard should work correctly with multiple views.
2025-02-13 02:30:33 +00:00
Robert Ancell
af3c91045b
Fix Linux keyboard support for AltGr ( #162495 )
...
This was previously connected to right alt, which was confusing the
keyboard handling code into generating up events for this key when it
didn't match the expected values. This key is also configurable, and
only defaults to right alt in Ubuntu/GNOME.
Fixes https://github.com/flutter/flutter/issues/154053
2025-02-11 01:03:48 +00:00
Byoungchan Lee
44785daf01
Roll gn to c97a86a72105f3328a540f5a5ab17d11989ab7dd ( #161012 )
...
The current version is more than 3 years old.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-05 01:09:14 +00:00
Robert Ancell
b68321a45d
Simplify hash table iteration. ( #162483 )
...
Removes the need to use structures to keep state and keeps logic in the
same function.
2025-02-05 01:03:04 +00:00
Robert Ancell
5a53ac3996
Fix warnings on startup about display monitor ( #162653 )
...
Create the display monitor at initialization, not engine start.
Handle case where the window is not visible and the monitor can't be
determined.
Don't leak the monitor when the engine is disposed.
2025-02-04 23:10:27 +00:00
Robert Ancell
b56b5b6a23
Keyboard tidy ups ( #162054 )
...
Make async calls use standard GLib async API.
Remove test specific methods.
Smaller cleanups.
2025-01-23 15:45:46 +00:00
Robert Ancell
6e9b863e6d
Replace hacky code creating fake devices ( #162056 )
2025-01-23 14:48:01 +00:00
Robert Ancell
2d3beadffe
Move FlKeyboardManager and FlKeyboardHandler from FlView to FlEngine. ( #161925 )
...
There can only be one handler that is shared between the views.
Move event redispatch matcher back into FlKeyboardManager - if a
redispatched event was moved between views due to a focus change it
would not be matched against.
2025-01-22 20:07:11 +00:00
Robert Ancell
e53bd2a103
Remove FlKeyboardViewDelegate ( #161705 )
...
Instead, do the filtering at the point the event is redispatched.
2025-01-21 23:18:20 +00:00
Robert Ancell
f2ce662fd2
Refactor event redispatching ( #161701 )
...
Instead of doing the redispatching from inside FlKeyboardManager, return
the event asynchronously to the code that provided the event in the
first case. That code has all the context on how to do the redispatch -
this will be more complicated in a multi-view case.
2025-01-17 01:01:49 +00:00