Skip to content

[macOS] Fix GesturePlatformManager.CalculatePosition when asked for a relative position - #19371

Merged
PureWeen merged 11 commits into
dotnet:mainfrom
MartyIX:feature/2023-12-12-pointer-gesture-relative
Jan 9, 2024
Merged

PureWeen merged 11 commits into
dotnet:mainfrom
MartyIX:feature/2023-12-12-pointer-gesture-relative

Conversation

@MartyIX

@MartyIX MartyIX commented Dec 12, 2023 •

Copy link
Copy Markdown
Contributor

Description of Change

This PR follows what I wrote here #19327 (comment). I'm not sure if the fix is correct or not. I just figured that creating a PR is an easy way to get some feedback.

Issues Fixed

Fixes #19329
Fixes #19327

@MartyIX
MartyIX requested a review from a team as a code owner December 12, 2023 18:54
@ghost ghost added the community ✨ Community Contribution label Dec 12, 2023
@ghost

ghost commented Dec 12, 2023

Copy link
Copy Markdown

Hey there @MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@MartyIX MartyIX changed the title WIP [macOS] Fix GesturePlatformManager.CalculatePosition when asked for a relative position Dec 12, 2023
@MartyIX

MartyIX commented Dec 12, 2023

Copy link
Copy Markdown
Contributor Author

Cursor is in both cases in the right-bottom corner of the red robot image.

Before
Before

After
After

@PureWeen
PureWeen self-requested a review December 12, 2023 19:24
@MartyIX

MartyIX commented Dec 13, 2023 •

Copy link
Copy Markdown
Contributor Author

Btw: The change this PR reverts was introduced here e84098b#diff-ad1a05553c13fe18565124521da4efa63ec857d8d9b6b3e248c1c4ea4497fed5R172 (#12108).

edit: Hm, so #12108 fixed #8330 so that is probably the thing that should be tested.

@PureWeen

Copy link
Copy Markdown
Member

Can you add a test?

Example of one here #19283

@MartyIX

MartyIX commented Dec 13, 2023

Copy link
Copy Markdown
Contributor Author

I can try but it would be great to know if the fix looks ok to you or not.

@MartyIX
MartyIX force-pushed the feature/2023-12-12-pointer-gesture-relative branch from 919e470 to ee002f2 Compare December 13, 2023 20:46
@PureWeen

PureWeen commented Dec 14, 2023 •

Copy link
Copy Markdown
Member

I can try but it would be great to know if the fix looks ok to you or not.

I need to understand a bit more about why the new code doesn't work, and if the fix here will break other cases. The view that it's currently using is a container view that sometimes gets created around the platform view. In some cases that container view will have visible parts. For example, if you add a background to a Label that background will be a view around the label that displays the background . So, I think this PR will cause some scenarios like that to become incorrect.

My guess at what is happening here is that the ContainerView is expanding to fill the entire horizontal space and then the image is just occupying the center. I'm curious if that's intentional or if there's a bug with ContainerView and it needs to be sized more correctly.

@MartyIX

MartyIX commented Dec 14, 2023

Copy link
Copy Markdown
Contributor Author

@PureWeen I don't know the code in depth to add any meaningful comment right now. However, I believe it's worth taking a step back and trying to first establish what platform is actually affected by a bug. For that purpose I have modified #19329 (comment) and added animations of the behavior on Windows and macOs for the same MAUI application.

The fact that the same source code leads to different outcomes on both platforms leads me to believe it's a bug.

However, given your previous response, I'm not actually sure if Windows or macOS behaves differently than as expected.

Could you take a look at those two animations please?

@Eilon Eilon added the area-gestures Gesture types label Dec 14, 2023
@PureWeen

PureWeen commented Dec 15, 2023 •

Copy link
Copy Markdown
Member

@PureWeen I don't know the code in depth to add any meaningful comment right now. However, I believe it's worth taking a step back and trying to first establish what platform is actually affected by a bug. For that purpose I have modified #19329 (comment) and added animations of the behavior on Windows and macOs for the same MAUI application.

The fact that the same source code leads to different outcomes on both platforms leads me to believe it's a bug.

However, given your previous response, I'm not actually sure if Windows or macOS behaves differently than as expected.

Could you take a look at those two animations please?

Nevermind :-) I see what's going on here now. We just made a bad refactor and your revert makes sense

@PureWeen

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@MartyIX
MartyIX force-pushed the feature/2023-12-12-pointer-gesture-relative branch from d152abd to 35dd0f7 Compare December 19, 2023 18:54
@MartyIX
MartyIX force-pushed the feature/2023-12-12-pointer-gesture-relative branch from 35dd0f7 to c0b1672 Compare December 22, 2023 09:27
@PureWeen
PureWeen force-pushed the feature/2023-12-12-pointer-gesture-relative branch from c0b1672 to ee64161 Compare January 4, 2024 15:49
@PureWeen

PureWeen commented Jan 4, 2024

Copy link
Copy Markdown
Member

/azp run

@dotnet dotnet deleted a comment from azure-pipelines Bot Jan 4, 2024
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines Bot Jan 4, 2024
@PureWeen

PureWeen commented Jan 4, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen

PureWeen commented Jan 5, 2024

Copy link
Copy Markdown
Member

OpenQA.Selenium.WebDriverException : An unknown server-side error occurred while processing the command. Original error: Error Domain=io.appium.WebDriverAgentMac Code=1 "Only pointer type 'mouse' is supported. 'touch' is given instead for action with id '0164df41-a79d-42c1-9f78-c4742f81238c'" UserInfo={NSLocalizedDescription=Only pointer type 'mouse' is supported. 'touch' is given instead for action with id '0164df41-a79d-42c1-9f78-c4742f81238c'}

I'll work on this one tomorrow

we're close

PureWeen and others added 2 commits January 5, 2024 10:10
….xaml

Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
@PureWeen

PureWeen commented Jan 5, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

PureWeen
PureWeen previously approved these changes Jan 5, 2024
PureWeen and others added 2 commits January 8, 2024 10:05
Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
@PureWeen

PureWeen commented Jan 8, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
PureWeen enabled auto-merge (squash) January 8, 2024 17:49
@PureWeen
PureWeen merged commit c1dfd70 into dotnet:main Jan 9, 2024
@MartyIX
MartyIX deleted the feature/2023-12-12-pointer-gesture-relative branch January 9, 2024 15:28
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

6 participants