Repository navigation
Issue 94804 gtk4 linux v2 - #186594
Closed
richyo-codes wants to merge 60 commits into
Closed
Issue 94804 gtk4 linux v2#186594richyo-codes wants to merge 60 commits into
richyo-codes wants to merge 60 commits into
Conversation
richyo-codes
force-pushed
the
issue-94804-gtk4-linux-may-rebase-v2
branch
5 times, most recently
from
June 1, 2026 05:29
8d69db0 to
c5694ec
Compare
richyo-codes
force-pushed
the
issue-94804-gtk4-linux-may-rebase-v2
branch
from
June 21, 2026 22:31
96f0a29 to
11ed8f4
Compare
Introduce the compatibility headers, accessibility semantics store, and GN plumbing needed to support GTK3 and GTK4 side by side without yet splitting the main runtime files.
Keep GTK3 as the default runtime path while teaching the shared Linux shell sources to build under GTK4 without the GTK3-only accessibility and widget APIs. This stage keeps the file layout mostly intact so the later refactor/split commits stay reviewable.
Move the GTK4 clipboard implementation out of the shared platform handler into a dedicated translation unit. The GTK3 path keeps its existing clipboard code, while the GTK4 path now has its own self-contained helper file and GN wiring.
Move the GTK4 cursor-position and IM context widget wiring out of fl_text_input_handler.cc into a dedicated GTK4 translation unit, and keep the shared handler using a private struct header for the split fields.
Purge semantics nodes that are no longer present after a full accessibility update so the cache does not retain dead ATK objects, and add a regression test that proves removed nodes finalize once the caller releases its own reference.
Move the GTK4 view setup, cursor handling, and legacy event controller plumbing into a dedicated translation unit, and move the private FlView state into a shared header so the GTK4 helper can use it without changing GTK3 behavior.
Move the GTK3 event and gesture setup out of fl_view.cc into a dedicated GTK3 translation unit. This keeps the shared view file focused on the common shell wiring and matches the existing GTK4 helper split.
Extract the GL texture drawing and readback painting paths into dedicated helpers so the shared compositor render function stays linear. This keeps the GTK4-specific deprecation handling isolated without changing the underlying framebuffer flow.
Move the GTK4 application window creation and first-frame presentation helpers into a dedicated translation unit. The shared application code now keeps the GTK3 path in place while the GTK4 setup lives alongside the other GTK4-specific helpers.
Move the GTK4 monitor enumeration into a dedicated translation unit so the shared display monitor logic stays focused on the engine update flow. The GTK3 path remains in the original file.
Teach the GTK4 render path to acquire a GdkTexture from the compositor and present it through the GTK4 render texture widget. Keep the legacy GTK3 Cairo path intact and add the software compositor texture fallback so GTK4 continues to work with both renderer types.
Thread the selected GTK variant through build, run, native assets, build directories, Dart defines, project pubspec defaults, and flutter config fallback.
Map GTK4 GDK event positions through the native surface transform into the Flutter render widget before sending pointer events. This keeps hover and click hit testing aligned with rendered content when GTK4 window chrome or widget transforms shift raw event coordinates.
Pass the GTK4 render-area pixel size into compositor texture acquisition instead of deriving it from the surface. Avoid waiting for a zero-sized frame during startup by retrying once the render area has a real allocation.
GTK4 no longer exposes the GTK3 display monitor-added/monitor-removed signals or GtkWidget::delete-event. Observe the GTK4 monitor list model instead and connect close handling through GtkWindow::close-request.
…e-94804-gtk4-linux-pr-stack-v7 Resolve the gtk4/linux and flutter_tools merge conflicts, with the Linux shell updates kept in sync and the darwin deployment target/template changes applied.
Add fl_compositor_opengl_shader.cc to the gtk4 source set and keep the linux GTK3/GTK4 split aligned with the shared OpenGL compositor implementation.
Add a GTK4 runtime API table for optional accessibility symbols and route gtk_accessible_set_accessible_parent through it when FLUTTER_LINUX_GTK4_RUNTIME_API_COMPAT is enabled. This lets GTK4 builds compiled against older headers use newer accessibility APIs when present at runtime without creating direct symbol relocations.
Resolve optional GTK4 accessibility APIs through a single runtime compat layer so the engine can keep building against the older GTK4 sysroot while opportunistically using newer tree and value-update entry points when available.
Make the GTK4-only runtime compat implementation file explicit in its name and update the Linux GN source list accordingly.
Rename the GTK4 runtime compat header to match the implementation file and use the runtime-resolved GTK4 announcement API so accessibility notifications are no longer dropped on the GTK4 path.
Keep the GTK4 semantics store live on each view, feed it from update-semantics, and use the cached root label when updating the view accessibility name.
Teach the Linux build to select a trixie x64 sysroot alongside bullseye so the engine can target both GTK4 baselines without changing the build flow.
Build the GTK4 accessibility tree from the semantics store behind a compile-time toggle, keep the GTK3 ATK path unchanged, and route GTK4 runtime accessibility updates through the compat layer.
Describe the native Linux popup and multi-window entrypoints, their GTK3 versus GTK4 behavior, and how sample apps such as flutter_multi_window_ffi_test should consume them.
…e-94804-gtk4-linux-pr-stack-v9
Resolve the renderer refactor merge while preserving GTK4 accessibility integration and the unified GTK3/GTK4 build paths.
Thread the VPYTHON_BYPASS environment through both GN generation and autoninja so the GTK4 compatibility build can regenerate in this environment. Also keep fl_view_test.cc out of the GTK4 unittest target so the GTK4 build stays free of GTK3-only ATK mocks.
Build a native GtkAccessible tree from Flutter semantics and expose it through the renderer on GTK 4.10 and newer. Resolve additive traversal APIs at runtime so GTK 4.8 remains the build and runtime fallback baseline, and validate both paths in distro containers.
Do not disconnect or unref the borrowed GdkKeymap after converting its signal handler to g_signal_connect_object. Destroying the display-owned keymap corrupts GDK keyboard state and can trigger xkb_state_unref failures during app startup.
adonm
added a commit
to adonm/flutter-dev
that referenced
this pull request
Aug 15, 2026
Both applications now consume the official Flutter beta with the stock GTK3 embedder, so the sdk/ and plugins/ submodules and the engine/SDK build-and-publish pipeline are no longer needed. The workspace keeps apps/zuko, apps/vixen, and the libghostty/flterm fork; the retired framework work lives on in the adonm/flutter fork for the upstream GTK4 effort (flutter/flutter#186594).
Contributor
Author
|
Started a new PR here #193405 with intent to actually get reviewed Closing this one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue 94804
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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.