Repository navigation
refactor(linux): extract GTK3 pointer, touch and gesture handling - #194913
Draft
richyo-codes wants to merge 2 commits into
Draft
richyo-codes wants to merge 2 commits into
richyo-codes wants to merge 2 commits into
Conversation
Move the existing event callbacks together with their signal connections, event-box setup and gesture creation out of FlView. GTK4 uses a different event API; separating the GTK3 adapters reduces overlap with view lifecycle and rendering changes. Keyboard and focus handling remain in fl_view.cc. Move the unchanged instance definition into the existing private header. Document the setup timing and existing widget/gesture ownership. Preserve input dispatch, initialization order, disposal and public API. This change is independent of surface helpers and accessibility work and does not enable GTK4. Validation: all 21 extracted functions, the instance definition and setup statements match the merge base. C++/GN formatting and diff checks pass. Recompiled 146 Linux source/test translation units using the existing GTK3 build flags and Bullseye sysroot, then linked the GTK3 library and unit-test executable against cached engine dependencies. All 855 Linux tests pass. This is not a fresh full-engine build with baseline-synced dependencies.
Exercise event-box and gesture signals through FlView construction and assert events at the embedder boundary. Cover button/motion/release dispatch, multi-click filtering, scrolling, touch, combined zoom/rotation, and cancellation on broken grabs, grab changes, and unmap. All eight new tests pass against the extraction and a pre-extraction view object. Removing the broken-grab connection makes the cancellation test fail. Related view/input suites pass 56 tests using the existing GTK3 configuration and cached engine dependencies; this is not a fresh full-engine build.
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.
Summary
fl_view.cccurrently mixes GTK3 pointer, scrolling, touch, and gesture handling with view lifecycle and rendering code. This PR moves those callbacks and their setup intofl_view_input_gtk3.cc, keeping the GTK3 event handling together and reducing overlap with future GTK4 changes.The extraction preserves existing input behavior and the public API.
#194698
Changes
fl_view_input_gtk3.cc.fl_view_input_gtk3_setup()at the original setup point infl_view_init(), preserving initialization order._FlViewinstance definition into the existingfl_view_private.hso both implementation files can access the view’s state.Callback logic, instance layout, and existing disposal responsibilities are preserved. Keyboard and focus handling remain in
fl_view.cc.Validation
Validation used cached engine dependencies; a fresh full-engine build with dependencies synchronized to the PR’s base was not performed.
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.