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

Gridsplitter controls sometimes causes the pointer to disappear #2017

Open
fatcatz888 opened this issue Apr 25, 2018 · 17 comments
Open

Gridsplitter controls sometimes causes the pointer to disappear #2017

fatcatz888 opened this issue Apr 25, 2018 · 17 comments
Assignees
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ help wanted Issues identified as good community contribution opportunities no-recent-activity 📉 Open Issues that require attention
Milestone

Comments

@fatcatz888
Copy link

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

If my app navigates to a new page with gridsplitter controls sometimes the cursor disappears. The cursor only appears if hovering over a gridsplitter control.

Expected behavior

The cursor should be visible.

Minimal reproduction of the problem with instructions

Create a page with 2 gridsplitter controls, then from the main page navigate back and forth a few times to the page with the gridsplitters. Eventually, the cursor disappears.

Environment

Nuget Package(s): 
Microsoft.Toolkit v2.2.0
Microsoft.Toolkit.Uwp v2.2.0
Microsoft.Toolkit.Uwp v2.2.0
Microsoft.Toolkit.Uwp.Controls v2.2.0

Package Version(s): 

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [X ] Fall Creators Update (16299)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [X ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ X] 2017 (version: version: 15.6.6)
- [ ] 2017 Preview (version: )

@nmetulev
Copy link
Contributor

@shweaver-MSFT, could you look at this as part of #2013?

@shweaver-MSFT
Copy link
Member

Ya, no problem. I'll try out the repro and see what's going on.

@shweaver-MSFT
Copy link
Member

@nmetulev, I can't seem to repro the issue. I created an app with 2 pages. MainPage has a button that navigates to the OtherPage. OtherPage has 2 GridSplitters and a few buttons to navigate back to Main. I tried navigating back/forth dozens of times with no issue. Cursor is always visible and changes as expected when hovering/manipulating the GridSplitter.

Test app is here: https://github.com/shweaver-MSFT/GridSplitterCursorTest

@fatcatz888, would you mind trying out the test app to compare with the issue you are seeing? Or do you have an encapsulated repro I could try?

@fatcatz888
Copy link
Author

I'll give it a test.

Thanks

@CommunityToolkit CommunityToolkit deleted a comment from shweaver-MSFT May 2, 2018
@michael-hawker
Copy link
Member

michael-hawker commented May 4, 2018

I just hit this too, but couldn't repro again when I redid what I thought I did. We can clean-up the GridSplitter to use our Mouse Cursor extensions, that may help maybe. I can look at it after Build as I should try and finish and add in my ContentSizer sister control.

@fatcatz888
Copy link
Author

Thanks for the update. Since you can reproduce the bug too now I won't be pulling my hair out trying to get the test app to make the cursor disappear!

I just know it is completely random.

@nmetulev nmetulev added bug 🐛 An unexpected issue that highlights incorrect behavior help wanted Issues identified as good community contribution opportunities labels May 15, 2018
@lucaasrojas
Copy link
Contributor

What's the current status of this issue?

@nmetulev nmetulev added this to the 4.0 milestone Jul 11, 2018
@lucaasrojas
Copy link
Contributor

I tried to replicate the issue using the v2.2 and v3.0 without success. I also tried moving the back button outside of the grid, but I couldn't replicate the issue.

@kbrons
Copy link
Contributor

kbrons commented Jul 30, 2018

@michael-hawker Did you have a chance to look at this?

@michael-hawker
Copy link
Member

@kbrons @shweaver-MSFT I think I hit this again. I was on a Surface Book, so I wonder if it's HW dependent?

@nmetulev nmetulev modified the milestones: 4.0, 4.1 Aug 10, 2018
@fatcatz888
Copy link
Author

FYI it just occurred again after I upgraded to 4.0.0. I was testing GridSplitter in the Windows Community Toolkit Sample App using a Desktop PC. If I open the Mouse extension example the cursor appears normal again.

@nmetulev nmetulev modified the milestones: 4.1, 5.0 Sep 26, 2018
@kbrons
Copy link
Contributor

kbrons commented Oct 16, 2018

@fatcatz888 what's the hardware you're testing on? I can't reproduce it on a ThinkPad X1.

@fatcatz888
Copy link
Author

fatcatz888 commented Oct 18, 2018

It happens on my Asus notebook (n550) and Asus desktop. I'm quite sure it is not hardware as I have other UWP apps that do not have this issue.

My only app that uses the GridSplitter shows this issue. If the mouse moves out of the app's window the cursor reappears. Move it back inside the app's window, the cursor disappears.

I've added code so that if the user manages to hit the back button to go back to the main page then my app forces the cursor to show again with code at OnNavigatedTo

if (e.NavigationMode == NavigationMode.New)
  {
    _defaultCursor = Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor;
   }
   else
   {
     if (_defaultCursor != Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor)
     {
       Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = _defaultCursor;
     }
}

This seems to partly fix the issus.

@nmetulev nmetulev modified the milestones: 5.0, 5.1 Oct 26, 2018
@michael-hawker
Copy link
Member

I know the GridSplitter uses a different implementation, but I need to compare it to the Mouse Cursor extension ones as I can hit this issue with the Mouse Cursor extensions as well.

@michael-hawker
Copy link
Member

I have a fix for the Mouse Cursor extension, and I suspect the problem is the same here (though we should have Grid Splitter use the Mouse extensions).

Turns out Pointer Exit is sometimes called originating from the element itself, which in turn causes it to set the pointer to the changed cursor instead of back to something else.

I added a sender != e.OriginalSource to the if condition and that seems to work like a charm. I'll make sure to submit that fix soon for Mouse Cursor and see if it can be applied here.

@michael-hawker michael-hawker self-assigned this Jan 15, 2019
@michael-hawker
Copy link
Member

Grid Splitter's logic is different and much more complex than the Mouse extension. I think for 6.0 we refactor Grid Splitter to use the Mouse Extension. I already have an implementation we can use of a 'ContentSplitter' that uses the extensions. I'll submit a PR soon after the 5.1 release.

@michael-hawker michael-hawker modified the milestones: 5.1, 6.0 Feb 8, 2019
@michael-hawker
Copy link
Member

@azchohfi this is still an issue, I had just referenced it in the other PR as I thought it was the same originally and its where the fix stemmed from. I'm going to resolve this issue in 6.0 by making GridSplitter use the fixed Mouse Cursor extensions.

@michael-hawker michael-hawker reopened this Feb 8, 2019
@Kyaa-dost Kyaa-dost added the no-recent-activity 📉 Open Issues that require attention label Oct 2, 2019
@michael-hawker michael-hawker modified the milestones: 6.0, 6.1 Oct 24, 2019
@michael-hawker michael-hawker modified the milestones: 6.1, 7.0 May 26, 2020
@Kyaa-dost Kyaa-dost modified the milestones: 7.0, 7.1 Feb 18, 2021
@ghost ghost added the In-PR 🚀 label Jun 21, 2021
@michael-hawker michael-hawker modified the milestones: 7.1, 7.2/8.0? Aug 31, 2021
@ghost ghost removed the In-PR 🚀 label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ help wanted Issues identified as good community contribution opportunities no-recent-activity 📉 Open Issues that require attention
Projects
None yet
9 participants