Repository navigation
Connect to moved-to-rect after the window is realized - #191773
Conversation
moved-to-rect is a GdkWindow signal, but it was being connected before the window was realized, when gtk_widget_get_window() still returns NULL. This logged a GLib critical and left the signal unconnected, so popup windows were never told where they ended up. Connect to the signal when the window is realized instead, additionally doing so immediately if it has been realized already. Add tests covering all of the window monitor functionality. These need a Dart isolate to be current, so add a MockIsolate that boots one from the snapshot already linked into the test binary.
There was a problem hiding this comment.
Code Review
This pull request updates the Linux platform shell to handle the GdkWindow 'moved-to-rect' signal dynamically by connecting to the window's 'realize' signal, ensuring the connection is re-established if the widget is unrealized and realized again. It also adds a comprehensive suite of unit tests for FlWindowMonitor, along with mock implementations for GTK and Dart isolates. The review feedback identifies a signature mismatch in the 'realize_cb' callback when registered with G_CONNECT_SWAPPED, which can lead to undefined behavior in C++, and suggests updating the callback signature and its invocation to include the GtkWidget* argument.
mattkae
left a comment
There was a problem hiding this comment.
Lots of tests! This is a little more than what the PR describes, but I'll let it slide 😄
|
autosubmit label was removed for flutter/flutter/191773, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
The linux unit tests have no Dart VM, so booting a real isolate for them only worked in JIT builds where the core snapshot is linked in. Profile and release builds use the AOT runtime and have no snapshot, so this failed to link. Only enter an isolate if there is one instead.
flutter/flutter@e8dca90...8d8c1aa 2026-08-28 [email protected] Roll Packages from bd3cbc1 to cd4cdd0 (15 revisions) (flutter/flutter#191965) 2026-08-28 [email protected] Bump customer testing version to pick up forui tests (flutter/flutter#191931) 2026-08-28 [email protected] Use leading scroll offset instead of infinite offset to reveal pinned slivers (flutter/flutter#191329) 2026-08-28 [email protected] Roll Skia from 21f71051e749 to fe0b9a5261f9 (1 revision) (flutter/flutter#191960) 2026-08-28 [email protected] Share the common Linux window controller code in mixins (flutter/flutter#191930) 2026-08-28 [email protected] Roll Dart SDK from 2cf2f69fd9f0 to ae63a6eca3f1 (1 revision) (flutter/flutter#191953) 2026-08-28 [email protected] Roll Skia from 11e3a7cb0fd0 to 21f71051e749 (3 revisions) (flutter/flutter#191942) 2026-08-28 [email protected] Roll Dart SDK from e030e77d5413 to 2cf2f69fd9f0 (2 revisions) (flutter/flutter#191934) 2026-08-28 [email protected] Remove no-shuffle in flutter tools overall experience test (flutter/flutter#191861) 2026-08-28 [email protected] [flutter_tools] Gracefully handle Windows Application Control and security policy execution blocks (flutter/flutter#191912) 2026-08-28 [email protected] [tool] Migrate ConfigCommand to modular dependency injection (flutter/flutter#190743) 2026-08-28 [email protected] Roll Skia from 37459da0a755 to 11e3a7cb0fd0 (9 revisions) (flutter/flutter#191929) 2026-08-28 [email protected] Connect to moved-to-rect after the window is realized (flutter/flutter#191773) 2026-08-28 [email protected] macOS: Compare accessibility strings as NSStrings in tests (flutter/flutter#191853) 2026-08-28 [email protected] macOS: Record test accessibility notifications in a dictionary (flutter/flutter#191854) 2026-08-28 [email protected] Roll Fuchsia Test Scripts from 6SXRz6wsA2Zm_rAqP... to u_fSMsPU22VvUsvSo... (flutter/flutter#191927) 2026-08-28 [email protected] Roll Dart SDK from cb4c39d067f3 to e030e77d5413 (3 revisions) (flutter/flutter#191923) 2026-08-27 [email protected] Migrate ios driver tests batch 2 to simulators (flutter/flutter#190930) 2026-08-27 [email protected] [flutter_test] Ensure LiveTestWidgetsFlutterBinding executes frame and pointer callbacks in the test zone (flutter/flutter#191595) 2026-08-27 [email protected] Deprecate legacy gen_defaults tool (flutter/flutter#191911) 2026-08-27 [email protected] Fix black window in the subsurface view renderer (flutter/flutter#191850) 2026-08-27 [email protected] Roll Skia from 82e972ea84b1 to 37459da0a755 (10 revisions) (flutter/flutter#191906) 2026-08-27 [email protected] iOS: Key the platform view factory registries by NSString (flutter/flutter#191855) 2026-08-27 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#191895) 2026-08-27 [email protected] [flutter_tools] Honor configured build-dir across flutter project and build targets (flutter/flutter#191592) 2026-08-27 [email protected] Revert: Handle linear and radial gradients in UberSDF (flutter/flutter#191913) 2026-08-27 [email protected] Explicitly disable HCPP in hybrid_android_views integration test (flutter/flutter#191894) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#12679) flutter/flutter@e8dca90...8d8c1aa 2026-08-28 [email protected] Roll Packages from bd3cbc1 to cd4cdd0 (15 revisions) (flutter/flutter#191965) 2026-08-28 [email protected] Bump customer testing version to pick up forui tests (flutter/flutter#191931) 2026-08-28 [email protected] Use leading scroll offset instead of infinite offset to reveal pinned slivers (flutter/flutter#191329) 2026-08-28 [email protected] Roll Skia from 21f71051e749 to fe0b9a5261f9 (1 revision) (flutter/flutter#191960) 2026-08-28 [email protected] Share the common Linux window controller code in mixins (flutter/flutter#191930) 2026-08-28 [email protected] Roll Dart SDK from 2cf2f69fd9f0 to ae63a6eca3f1 (1 revision) (flutter/flutter#191953) 2026-08-28 [email protected] Roll Skia from 11e3a7cb0fd0 to 21f71051e749 (3 revisions) (flutter/flutter#191942) 2026-08-28 [email protected] Roll Dart SDK from e030e77d5413 to 2cf2f69fd9f0 (2 revisions) (flutter/flutter#191934) 2026-08-28 [email protected] Remove no-shuffle in flutter tools overall experience test (flutter/flutter#191861) 2026-08-28 [email protected] [flutter_tools] Gracefully handle Windows Application Control and security policy execution blocks (flutter/flutter#191912) 2026-08-28 [email protected] [tool] Migrate ConfigCommand to modular dependency injection (flutter/flutter#190743) 2026-08-28 [email protected] Roll Skia from 37459da0a755 to 11e3a7cb0fd0 (9 revisions) (flutter/flutter#191929) 2026-08-28 [email protected] Connect to moved-to-rect after the window is realized (flutter/flutter#191773) 2026-08-28 [email protected] macOS: Compare accessibility strings as NSStrings in tests (flutter/flutter#191853) 2026-08-28 [email protected] macOS: Record test accessibility notifications in a dictionary (flutter/flutter#191854) 2026-08-28 [email protected] Roll Fuchsia Test Scripts from 6SXRz6wsA2Zm_rAqP... to u_fSMsPU22VvUsvSo... (flutter/flutter#191927) 2026-08-28 [email protected] Roll Dart SDK from cb4c39d067f3 to e030e77d5413 (3 revisions) (flutter/flutter#191923) 2026-08-27 [email protected] Migrate ios driver tests batch 2 to simulators (flutter/flutter#190930) 2026-08-27 [email protected] [flutter_test] Ensure LiveTestWidgetsFlutterBinding executes frame and pointer callbacks in the test zone (flutter/flutter#191595) 2026-08-27 [email protected] Deprecate legacy gen_defaults tool (flutter/flutter#191911) 2026-08-27 [email protected] Fix black window in the subsurface view renderer (flutter/flutter#191850) 2026-08-27 [email protected] Roll Skia from 82e972ea84b1 to 37459da0a755 (10 revisions) (flutter/flutter#191906) 2026-08-27 [email protected] iOS: Key the platform view factory registries by NSString (flutter/flutter#191855) 2026-08-27 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#191895) 2026-08-27 [email protected] [flutter_tools] Honor configured build-dir across flutter project and build targets (flutter/flutter#191592) 2026-08-27 [email protected] Revert: Handle linear and radial gradients in UberSDF (flutter/flutter#191913) 2026-08-27 [email protected] Explicitly disable HCPP in hybrid_android_views integration test (flutter/flutter#191894) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#12679) flutter/flutter@e8dca90...8d8c1aa 2026-08-28 [email protected] Roll Packages from bd3cbc1 to cd4cdd0 (15 revisions) (flutter/flutter#191965) 2026-08-28 [email protected] Bump customer testing version to pick up forui tests (flutter/flutter#191931) 2026-08-28 [email protected] Use leading scroll offset instead of infinite offset to reveal pinned slivers (flutter/flutter#191329) 2026-08-28 [email protected] Roll Skia from 21f71051e749 to fe0b9a5261f9 (1 revision) (flutter/flutter#191960) 2026-08-28 [email protected] Share the common Linux window controller code in mixins (flutter/flutter#191930) 2026-08-28 [email protected] Roll Dart SDK from 2cf2f69fd9f0 to ae63a6eca3f1 (1 revision) (flutter/flutter#191953) 2026-08-28 [email protected] Roll Skia from 11e3a7cb0fd0 to 21f71051e749 (3 revisions) (flutter/flutter#191942) 2026-08-28 [email protected] Roll Dart SDK from e030e77d5413 to 2cf2f69fd9f0 (2 revisions) (flutter/flutter#191934) 2026-08-28 [email protected] Remove no-shuffle in flutter tools overall experience test (flutter/flutter#191861) 2026-08-28 [email protected] [flutter_tools] Gracefully handle Windows Application Control and security policy execution blocks (flutter/flutter#191912) 2026-08-28 [email protected] [tool] Migrate ConfigCommand to modular dependency injection (flutter/flutter#190743) 2026-08-28 [email protected] Roll Skia from 37459da0a755 to 11e3a7cb0fd0 (9 revisions) (flutter/flutter#191929) 2026-08-28 [email protected] Connect to moved-to-rect after the window is realized (flutter/flutter#191773) 2026-08-28 [email protected] macOS: Compare accessibility strings as NSStrings in tests (flutter/flutter#191853) 2026-08-28 [email protected] macOS: Record test accessibility notifications in a dictionary (flutter/flutter#191854) 2026-08-28 [email protected] Roll Fuchsia Test Scripts from 6SXRz6wsA2Zm_rAqP... to u_fSMsPU22VvUsvSo... (flutter/flutter#191927) 2026-08-28 [email protected] Roll Dart SDK from cb4c39d067f3 to e030e77d5413 (3 revisions) (flutter/flutter#191923) 2026-08-27 [email protected] Migrate ios driver tests batch 2 to simulators (flutter/flutter#190930) 2026-08-27 [email protected] [flutter_test] Ensure LiveTestWidgetsFlutterBinding executes frame and pointer callbacks in the test zone (flutter/flutter#191595) 2026-08-27 [email protected] Deprecate legacy gen_defaults tool (flutter/flutter#191911) 2026-08-27 [email protected] Fix black window in the subsurface view renderer (flutter/flutter#191850) 2026-08-27 [email protected] Roll Skia from 82e972ea84b1 to 37459da0a755 (10 revisions) (flutter/flutter#191906) 2026-08-27 [email protected] iOS: Key the platform view factory registries by NSString (flutter/flutter#191855) 2026-08-27 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#191895) 2026-08-27 [email protected] [flutter_tools] Honor configured build-dir across flutter project and build targets (flutter/flutter#191592) 2026-08-27 [email protected] Revert: Handle linear and radial gradients in UberSDF (flutter/flutter#191913) 2026-08-27 [email protected] Explicitly disable HCPP in hybrid_android_views integration test (flutter/flutter#191894) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
moved-to-rect is a GdkWindow signal, but it was being connected before the window was realized, when gtk_widget_get_window() still returns NULL. This logged a GLib critical and left the signal unconnected, so popup windows were never told where they ended up.
Connect to the signal when the window is realized instead, additionally doing so immediately if it has been realized already.
Add tests covering all of the window monitor functionality. These need a Dart isolate to be current, so add a MockIsolate that boots one from the snapshot already linked into the test binary.