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

[WinUI3 Reunion 0.5] Hover Cursor on GridSplitter Not Displaying & Unable to Set Window Cursor #4834

Closed
eleanorleffler opened this issue Apr 15, 2021 · 10 comments
Labels
product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team v0.5 Issues introduced in the Project Reunion 0.5 prerelease wct wpf-vs-winui-mismatch

Comments

@eleanorleffler
Copy link

Describe the bug

In UWP, the cursor changes when hovering over a GridSplitter.
In WinUI 3, Reunion 0.5 it doesn't change until you click and drag the GridSplitter.

In attempt to fix this, we would like to set the window cursor programmatically. But, we were unable to do so.

In WinUI 3 Reunion 0.5, there is no way to set the Window Cursor in the code.
For example, we want to change the cursor to a wait cursor while an action is taking place that may take a few moments.

In UWP, this is accomplished with code like this:

CoreWindow coreWindow = CoreWindow.GetForCurrentThread();
coreWindow.PointerCursor = new CoreCursor(CoreCursorType.Wait, 1);

In WinUI 3, Reunion 0.5, the PointerCursor property is not available.

Steps to reproduce the bug

  1. Clone the WinUI3Reunion05_Problems.
  2. Go to the WinUI3IssuesReunion05 folder.
  3. Open the WinUI3IssuesReunion05.sln solution in Visual Studio 2019 Preview.
  4. Build and run with Debug x64.
  5. Click on the fifth item on the Navigation View ("Grid Splitter").
  6. Hover over GridSplitter.
  7. Notice that the cursor icon does not change until you click and drag.

Expected behavior

We expect the cursor icon to change when hovering over a GridSplitter. This behavior would be the same behavior as the behavior in UWP. We also expect there to be a way to programmatically set the window cursor as needed in WinUI like we were able to in UWP.

Screenshots

Screenshot

Screenshot#1 - Sample Solution Screenshot

Version Info

Targeting:
Target: Universal Windows
Target version: Windows 10, version 2004 (10.0; Build19041)
Min version: Windows 10, version 1809 (10.0; Build 17763)

NuGet package version:
[Microsoft.ProjectReunion 0.5.0]
[Microsoft.ProjectReunion.WinUI 0.5.0]

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763) Yes
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 15, 2021
@eleanorleffler eleanorleffler changed the title [Reunion 0.5] Hover Cursor on GridSplit Not Displaying & Unable to Set Window Cursor [WinUI3 Reunion 0.5] Hover Cursor on GridSplit Not Displaying & Unable to Set Window Cursor Apr 15, 2021
@StephenLPeters StephenLPeters added v0.5 Issues introduced in the Project Reunion 0.5 prerelease team-Reach Issue for the Reach team product-winui3 WinUI 3 issues labels Apr 15, 2021
@StephenLPeters
Copy link
Contributor

@Austin-Lamb and @michael-hawker FYI

@eleanorleffler eleanorleffler changed the title [WinUI3 Reunion 0.5] Hover Cursor on GridSplit Not Displaying & Unable to Set Window Cursor [WinUI3 Reunion 0.5] Hover Cursor on GridSplitter Not Displaying & Unable to Set Window Cursor Apr 15, 2021
@codendone
Copy link
Contributor

Is this not a dup of #4201?

@eleanorleffler
Copy link
Author

Hi @codendone ,

My team has been updating to each of the releases to test changes in bugs and functionality. This issue is for the most recent release of Reunion 0.5 while the other issue is for Preview 4.

However, the bug is the same - we just wanted to supply an updated solution for the bug!

Thanks!

@michael-hawker
Copy link
Collaborator

Yeah, this is a dup of #4201, there's been no change to the WinUI API surface or the Toolkit surface in this time. I'll add more info to the Preview 4 bug.

@codendone codendone added team-Rendering Issue for the Rendering team and removed needs-triage Issue needs to be triaged by the area owners team-Reach Issue for the Reach team labels Aug 12, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Aug 12, 2021
@codendone
Copy link
Contributor

Using this issue as the main one to track. See #4201 for more discussion on the issue.

@michael-hawker
Copy link
Collaborator

Part of this is due to how GridSplitter was initially designed in the Toolkit, I have an open issue in the Toolkit here tracking that work: CommunityToolkit/WindowsCommunityToolkit#2976

I hope to get to it to our 7.1 work, it's the 2nd thing on my list at the moment. I have a draft PR open, but it doesn't have any parts of GridSplitter fixed yet as it's pulling in another helper to use as a base.

That work should make it easier for us in WinUI 3 to use the protected Cursor property and at least make the control usable, though the underlying issue of this being harder to customize in WinUI 3 compared to UWP remains. Which I think is now being tracked or at least related to in-general to #506?

@michael-hawker
Copy link
Collaborator

For GridSplitter in the Toolkit, we've re-worked for using ProtectedCursor in Toolkit Labs, but that'll be fixed in our 8.0 release.

There's still a gap in setting the general cursor which blocks our extension from working (or doing other scenarios that WPF made easy here).

Probably should rename this issue title to be more about the 'Unable to Set Window Cursor' or about PointerCursor? Or providing the WPF Cursor like property: https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement.cursor

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@michael-hawker
Copy link
Collaborator

The new GridSplitter is in the new Windows Community Toolkit repo here: https://github.com/CommunityToolkit/Windows

It'll ship as part of our upcoming 8.0 release which will work for both WinUI 2 and 3 based apps. The component is available on our preview feed, we should have a preview on NuGet as well soon.

Think we can close this issue out?

@JJBrychell
Copy link

It appears this requested was made to workaround a issue with the community toolkit's GridSplitter control. It also appears that with the 8.0 release of the toolkit, this GridSplitter issue will be resolved. Since the underlying issue will be corrected, we are going to close this issue. If there is further need for the capability to explicitly set the cursor, please file a Feature Proposal request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team v0.5 Issues introduced in the Project Reunion 0.5 prerelease wct wpf-vs-winui-mismatch
Projects
None yet
Development

No branches or pull requests

6 participants