Open fatcatz888 opened 6 years ago
@shweaver-MSFT, could you look at this as part of #2013?
Ya, no problem. I'll try out the repro and see what's going on.
@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?
I'll give it a test.
Thanks
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.
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.
What's the current status of this issue?
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.
@michael-hawker Did you have a chance to look at this?
@kbrons @shweaver-MSFT I think I hit this again. I was on a Surface Book, so I wonder if it's HW dependent?
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.
@fatcatz888 what's the hardware you're testing on? I can't reproduce it on a ThinkPad X1.
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.
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.
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.
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.
@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.
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