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

ListView (WinUI3) control occasionaly freezes until mouse is clicked on some other item #7972

Closed
anup-das opened this issue Nov 29, 2022 · 6 comments
Labels
area-Lists ListView, GridView, ListBox, etc bug Something isn't working

Comments

@anup-das
Copy link

anup-das commented Nov 29, 2022

Describe the bug

I have implemented a file explorer like functionality in my app. The list of sub-folders are displayed in a listview control.
Based on user actions in the UI, I have to completely remove all items in the ListView control and repopulate them.

In testing i found that ListView control is freezing occasionaly ( 1 in 10 or times). i.e. Items are showing normally but verical scrollbar is not visible when it is expected, moving mouse pointer / wheel has no effect - no highlighted item is shown). It remains in this state until I click somewhere else in the window or even outside the window after few seconds.

I have tried using x:Bind and directly populating the items of the control (code-behind) both have the same result.

Steps to reproduce the bug

Populate ListViewControl and remove all items. Repeat this frequently based on some user action like clicking a button say 10 to 15 times and you should see this issue.

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.2.2: 1.2.221209.1

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@anup-das anup-das added the bug Something isn't working label Nov 29, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Nov 29, 2022
@anup-das
Copy link
Author

anup-das commented Dec 7, 2022

Update: I ported the same code to C# and the issue seems to have gone! I suspect this to be a threading issue related to C++/WinRT co_routine implementation

@Scottj1s
Copy link
Member

Scottj1s commented Dec 8, 2022

@anup-das Thanks for reporting. If possible, please provide a minimal repro project.

@Scottj1s Scottj1s added area-Lists ListView, GridView, ListBox, etc and removed needs-triage Issue needs to be triaged by the area owners labels Dec 8, 2022
@anup-das
Copy link
Author

anup-das commented Dec 9, 2022

@Scottj1s I have made a minimal repro project to reproduce the issue as well as issue #7975 (currently disabled with #if 0 statement). Test.zip

Instructions to repro:

  1. The app currently reads the folders of Music library. So populate the Music library with lots of folders. You can modify this if you want with any location containing lots of folders with multiple levels of sub-folders. I run into this issue 1 in 20 times with my music library of 2,116 folders on a mechanical hard disk drive (slower than an SSD) :-)
  2. Build and run the app
  3. Navigate to deeply nested folder levels and then use BreadcrumBar control at top to go back to previous level. Often try to jump back to the root level which hopefully contains many items

I run into the listview freezes issue with one of the following 1) icons do not refresh or 2) listview click is unresponsive or 3) moving the mouse wheel has no effect. I then move the mouse to the minimize title bar button to trigger some messages in the application message queue after which the list view un-freezes.

I have a more complex scenario in my app that also list files along with the folders. I hope the minimal test app would repo the issue. BTW this does not happen in C# which has a different implementation (Task and await) than C++/WinRT's co_await (co_routines). I would like to know what I am doing wrong in C++. Thanks.

@sylveon
Copy link
Contributor

sylveon commented Dec 16, 2022

I looked at your app and noticed that the Windows App SDK was out of date - I updated it and ran the app and cannot reproduce either of your issues. Is it also fixed on your side if you update the SDK?

@anup-das
Copy link
Author

anup-das commented Dec 17, 2022

image

Here is a video recording of the control freezing with latest SDK (1.2.221209.1)

ListView.freezes.mp4

@anup-das
Copy link
Author

Unable to repro with 1.3 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Lists ListView, GridView, ListBox, etc bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants