Repository navigation
Revert: Windows: fix for popup descendent of popup closing the whole tree when the 2nd popup gains focus - #197530
Conversation
…tree when the 2nd popup gains focus (flutter#196911)" This reverts commit 43150a8.
There was a problem hiding this comment.
Code Review
This pull request removes nested popup integration tests and reverts the Win32 popup window activation logic to use GetForegroundWindow() instead of lParam and _WA_INACTIVE. Feedback indicates that reverting this logic re-introduces a known race condition where GetForegroundWindow() may not yet reflect the newly active window, causing the popup to erroneously destroy itself. It is recommended to retain the original deterministic activation logic and instead resolve any analysis failures by adding the missing dart:io import in the test file.
| int lParam, | ||
| ) { | ||
| if (message == _WM_ACTIVATE && (wParam & 0xFFFF) == _WA_INACTIVE) { | ||
| if (message == _WM_ACTIVATE) { |
There was a problem hiding this comment.
Reverting this change re-introduces a known race condition and reliability issue. During WM_ACTIVATE, GetForegroundWindow() is asynchronous and may not yet reflect the newly active window, which can cause the popup to erroneously destroy itself when it is being activated.\n\nUsing lParam with (wParam & 0xFFFF) == _WA_INACTIVE is the standard, deterministic way to handle this transition in Win32.\n\nIf the original PR failed analysis checks, it was likely due to a missing import 'dart:io'; in dev/integration_tests/windowing_test/test_driver/main_test.dart where Platform.isWindows was used. Please consider fixing the analysis issue (by adding the missing import) rather than reverting this important bug fix.
References
- The Flutter Repository Style Guide (Line 27) instructs to check for potential regressions and look for changes that might break existing functionality or introduce unexpected behavior in related areas. (link)
|
Detected the If you add the The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue". |
Reverts: Windows: fix for popup descendent of popup closing the whole tree when the 2nd popup gains focus
Initiated by: @bkonyi
Reason for reverting: failing analysis checks.
Original PR Author: @mattkae
Reviewed By: @robert-ancell
The original PR description is provided below:
What's new?
This fixes a windows bug where a popup tree would erroneously close when a popup of a popup was focused.
fixes #193782
Pre-launch Checklist
///).