Repository navigation
refactor(linux): Extract GTK3 display monitor backend in preparation for GTK4 - #195324
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 GTK3 monitor enumeration and topology subscriptions behind a private backend while preserving display IDs, logical dimensions, and notification behavior. Add coverage for monitor snapshots, removal and readdition, ordering, signal cleanup, and engine destruction. The seven display tests pass before and after the extraction.
Make the GTK3 monitor backend start only once while allowing repeated starts to refresh the display snapshot. Cover hotplug notification counts and signal cleanup after repeated starts.
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
Part of #194698, which tracks incremental refactors of the GTK3 Linux embedder to enable GTK4 support cleanly.
This PR focuses on display monitoring. It moves GTK3-specific monitor discovery, scale-factor lookup, and hotplug signal subscriptions behind a private backend, while keeping display ID management and engine notifications in the shared
FlDisplayMonitorimplementation.This separation provides a clear integration point for a future GTK4 backend and helps keep toolkit-specific conditionals out of the shared display-management code. It is one independently reviewable piece of the preparatory work supporting #94804.
It also fixes duplicate signal subscriptions when
fl_display_monitor_start()is called more than once. Each call still publishes the current display snapshot, while subsequent monitor additions and removals produce a single update.Changes
FlDisplayMonitorBackendinterface, with the GTK3 implementation infl_display_monitor_gtk3.cc.monitor-added/monitor-removedsubscriptions into the backend.FlDisplayMonitor.Testing
Extend the GTK mocks to support configurable monitor lists, geometry, scale factors, and refresh rates. Add seven regression tests covering:
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.