-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Test inclusion for the PointerGestureRecognizer issue in MultiWindow. #31143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Windows-specific UI test coverage for a PointerGestureRecognizer issue that occurs when multiple windows are open. The test verifies that pointer enter and exit events are correctly handled after opening, minimizing, and interacting with windows.
- Implements the required two-part test structure with both HostApp UI and automated test components
- Adds Windows-specific multi-window management functionality using native Windows APIs
- Validates pointer gesture behavior in a multi-window scenario
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Controls/tests/TestCases.HostApp/Issues/Issue30536.cs | Creates UI test page with multi-window functionality and pointer gesture tracking |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30536.cs | Implements automated NUnit test to validate pointer gesture behavior across windows |
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
| public class Issue30536 : _IssuesUITest |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test creates a new window and then closes it, but there's no verification that the window was successfully closed or that the UI state was properly restored. Consider adding assertions to verify the window lifecycle operations completed successfully.
Copilot uses AI. Check for mistakes.
| private void MinimizeWindow(Window window) | ||
| { | ||
| #if WINDOWS | ||
| if (window.Handler?.PlatformView is Microsoft.UI.Xaml.Window win) |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MinimizeWindow method uses unsafe casting without error handling. If the cast fails or the PlatformView is null, the minimize operation will silently fail, which could cause test failures that are difficult to debug.
Copilot uses AI. Check for mistakes.
| { | ||
| // Get window handle directly from MAUI's platform view | ||
| var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(win); | ||
| ShowWindow(hwnd, SW_MINIMIZE); |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GetWindowHandle call could potentially return IntPtr.Zero if the window handle is invalid. Consider adding validation to ensure the handle is valid before calling ShowWindow.
| ShowWindow(hwnd, SW_MINIMIZE); | |
| if (hwnd != IntPtr.Zero) | |
| { | |
| ShowWindow(hwnd, SW_MINIMIZE); | |
| } |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…ltiWindow. (#31143) * Included the test for the PointerGesture Issue on windows * Used Windows API for minimizing the window * Minimize the window using GetWindowHandle * prevent unwanted issues
…ltiWindow. (#31143) * Included the test for the PointerGesture Issue on windows * Used Windows API for minimizing the window * Minimize the window using GetWindowHandle * prevent unwanted issues
…ltiWindow. (#31143) * Included the test for the PointerGesture Issue on windows * Used Windows API for minimizing the window * Minimize the window using GetWindowHandle * prevent unwanted issues
…ltiWindow. (#31143) * Included the test for the PointerGesture Issue on windows * Used Windows API for minimizing the window * Minimize the window using GetWindowHandle * prevent unwanted issues
…ltiWindow. (#31143) * Included the test for the PointerGesture Issue on windows * Used Windows API for minimizing the window * Minimize the window using GetWindowHandle * prevent unwanted issues
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Included the test for the PointerGestureRecognizer issue in windows
#30537