KEMBAR78
[Windows] Test inclusion for the PointerGestureRecognizer issue in MultiWindow. by Ahamed-Ali · Pull Request #31143 · dotnet/maui · GitHub
Skip to content

Conversation

@Ahamed-Ali
Copy link
Contributor

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

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Aug 13, 2025
@Ahamed-Ali Ahamed-Ali marked this pull request as ready for review August 13, 2025 09:57
@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 09:57
@Ahamed-Ali Ahamed-Ali requested a review from a team as a code owner August 13, 2025 09:57
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Aug 13, 2025

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)
Copy link

Copilot AI Aug 13, 2025

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);
Copy link

Copilot AI Aug 13, 2025

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.

Suggested change
ShowWindow(hwnd, SW_MINIMIZE);
if (hwnd != IntPtr.Zero)
{
ShowWindow(hwnd, SW_MINIMIZE);
}

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified

@jfversluis
Copy link
Member

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/current September 11, 2025 16:03
@PureWeen PureWeen merged commit caed481 into dotnet:inflight/current Sep 11, 2025
79 checks passed
PureWeen pushed a commit that referenced this pull request Sep 18, 2025
…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
PureWeen pushed a commit that referenced this pull request Sep 18, 2025
…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
github-actions bot pushed a commit that referenced this pull request Sep 18, 2025
…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
github-actions bot pushed a commit that referenced this pull request Sep 23, 2025
…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
github-actions bot pushed a commit that referenced this pull request Sep 23, 2025
…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
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants