Skip to content
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

[MacCatalyst] Implement PointerPressed and PointerReleased #16925

Merged
merged 12 commits into from Nov 27, 2023

Conversation

rachelkang
Copy link
Member

Description of Change

Implemented PointerPressed and PointerReleased for MacCatalyst

Issues Fixed

Fixes #13346

@samhouts samhouts added this to the .NET 8 GA milestone Aug 23, 2023
Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

it looks like some events are firing multiple times

<VerticalStackLayout>
        <Label Text="test me">
            <Label.GestureRecognizers>
                <PointerGestureRecognizer PointerReleased="PointerGestureRecognizer_PointerReleased"
                                          PointerEntered="PointerGestureRecognizer_PointerEntered"
                                          PointerExited="PointerGestureRecognizer_PointerExited"
                                          PointerMoved="PointerGestureRecognizer_PointerMoved"
                                          PointerPressed="PointerGestureRecognizer_PointerPressed"
                                          ></PointerGestureRecognizer>

            </Label.GestureRecognizers>

        </Label>

    </VerticalStackLayout>
    void PointerGestureRecognizer_PointerReleased(System.Object sender, Microsoft.Maui.Controls.PointerEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine("PointerGestureRecognizer_PointerReleased");
		}

		void PointerGestureRecognizer_PointerEntered(System.Object sender, Microsoft.Maui.Controls.PointerEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine("PointerGestureRecognizer_PointerEntered");
		}

		void PointerGestureRecognizer_PointerExited(System.Object sender, Microsoft.Maui.Controls.PointerEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine("PointerGestureRecognizer_PointerExited");
		}

		void PointerGestureRecognizer_PointerMoved(System.Object sender, Microsoft.Maui.Controls.PointerEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine("PointerGestureRecognizer_PointerMoved");
		}

		void PointerGestureRecognizer_PointerPressed(System.Object sender, Microsoft.Maui.Controls.PointerEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine("PointerGestureRecognizer_PointerPressed");
		}

If I press the mouse down and then move it outside the bounds of the label these are the events that I get raised after I release

PointerGestureRecognizer_PointerMoved
PointerGestureRecognizer_PointerMoved
PointerGestureRecognizer_PointerMoved
PointerGestureRecognizer_PointerReleased
PointerGestureRecognizer_PointerEntered
PointerGestureRecognizer_PointerExited

@MartyIX
Copy link
Collaborator

MartyIX commented Sep 16, 2023

I would love to test this. The events work great on Windows 👍.

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Seems like the build is failing by a merge error (duplicated member in GesturePlatformManager)

D:\a\_work\1\s\src\Controls\src\Core\Platform\GestureManager\GesturePlatformManager.Windows.cs(521,8): error CS0111: Type 'GesturePlatformManager' already defines a member called 'OnPgrPointerPressed' with the same parameter types [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net7.0-windows10.0.20348]
D:\a\_work\1\s\src\Controls\src\Core\Platform\GestureManager\GesturePlatformManager.Windows.cs(525,8): error CS0111: Type 'GesturePlatformManager' already defines a member called 'OnPgrPointerReleased' with the same parameter types [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net7.0-windows10.0.20348]
C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.3.230724000\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets(841,9): error MSB3073: The command ""C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.3.230724000\buildTransitive\..\tools\net5.0\..\net472\XamlCompiler.exe" "obj\Release\net7.0-windows10.0.20348\\input.json" "obj\Release\net7.0-windows10.0.20348\\output.json"" exited with code 1. [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net7.0-windows10.0.20348]
    16 Warning(s)
    6 Error(s)

@samhouts samhouts added the s/pr-needs-author-input PR needs an update from the author label Oct 9, 2023
@ghost
Copy link

ghost commented Oct 9, 2023

Hi @rachelkang. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time.

@rachelkang
Copy link
Member Author

oops, thanks for catching @jsuarezruiz - fixed!

@rachelkang rachelkang removed the s/pr-needs-author-input PR needs an update from the author label Oct 9, 2023
@samhouts
Copy link
Member

@rachelkang Failing tests?

@samhouts samhouts added the s/pr-needs-author-input PR needs an update from the author label Oct 16, 2023
@ghost
Copy link

ghost commented Oct 16, 2023

Hi @rachelkang. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time.

@rachelkang rachelkang removed the s/pr-needs-author-input PR needs an update from the author label Oct 23, 2023
@rachelkang
Copy link
Member Author

hopefully this makes the tests all happy! drag and drop appium tests look good now locally on mac

@rachelkang
Copy link
Member Author

yay all green now!!! phew

@rachelkang rachelkang requested a review from a team as a code owner October 25, 2023 20:25
@rachelkang rachelkang changed the base branch from main to net8.0 October 25, 2023 20:26
@rachelkang rachelkang removed the request for review from a team October 25, 2023 21:20
@PureWeen PureWeen changed the base branch from net8.0 to main October 27, 2023 15:18
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Have sense to include with this PR changes in the PointerGestureRecognizerEvents sample page and some UI Tests?. I can add it if you want.

@davidortinau
Copy link
Contributor

Would like to have this for parity pls

@MartyIX
Copy link
Collaborator

MartyIX commented Nov 15, 2023

Would like to have this for parity pls

I was first! :)

@tounaobun
Copy link

tounaobun commented Nov 22, 2023

I'm wondering why Windows supports PointerPressed & PointerReleased events while macOS doesn't support on 8.0.3 version. Hope this issue could be fixed in the next release.

@PureWeen PureWeen enabled auto-merge (squash) November 25, 2023 18:19
@PureWeen
Copy link
Member

/rebase

@PureWeen PureWeen merged commit 6b32433 into main Nov 27, 2023
47 checks passed
@PureWeen PureWeen deleted the mac-pointer-pressed-released branch November 27, 2023 03:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add PointerPressed and PointerReleased events and commands to PointerGestureRecognizer
9 participants