-
-
Notifications
You must be signed in to change notification settings - Fork 378
Fix freezing with gpu #3384
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
Closed
Closed
Fix freezing with gpu #3384
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emmmm, can I know all UIElement in all the window be clear cache? Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the settings window (secondary window) also have its cachemode=null? For now, separate from this PR, I tried settingwindow the cache mode of all UI elements in both the main window and the settings window to Null in code, but it didn’t resolve the issue.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@onesounds What worries me is that elements are added dynamically, and they are added after loading. And as my test, removing all the CacheMode can fix dotnet/wpf#2158 issues. If you can sure all the CacheMode be removed, I think may be you meet the other issues, not the dotnet/wpf#2158
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@onesounds Can I ask any other try update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't go well. Since we're using ModernWpf, I thought that instead of creating and building a new NuGet package to remove all the resources used by ModernWpf, I should find and remove them in the code — and I tried that, but it didn't work. I can’t tell if I’m doing it right, so I discussed it with Copilot and confirmed through debug code that all the caches were cleared, but even then, I’m not sure if it really worked correctly.
I also tested a few suggestions from cyclonring, but they all failed. The only thing that almost worked was an idea I came up with — showing the first window again at the moment of a "system change" (which removed the freezing of the settings window). But during testing, a focus loss situation. When the first window is hidden in this case, it causes the first window itself to freeze instead. I ended up giving up on this task because I discovered that the first window itself freezes as a result. #3378
I’ve asked my team members for help with this a few times, but no one seems interested. It feels like programmers tend to dislike this kind of work — the kind that doesn’t have a clear logic or defined answer and requires a lot of trial and error over a long period. Everyone seems to think it would be better and easier to just abandon WPF and move to something else. From my experience, I know that it's not that easy — which is why I want to find a solution within WPF.
In any case, I think it would be better if someone more capable than me took over this task and asked you questions. (The person you're talking to — me — is more of a designer and doesn’t really know much about programming.)
@Flow-Launcher/team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jack251970 I not sure this issus is same as dotnet/wpf#2158 . Maybe other case cause the freeze render issues.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're basically saying the same thing I described. After the lock screen, the settings window freezes, and then when the first window is shown, the settings window becomes active again. That's the basic structure of the changes I made in my initial PR. So you had told me, "There's an issue where the window is being shown," right? So I said something like, "This PR resolves the issue when the window is shown, so the fix is based on that behavior — therefore, it's not fair to consider the fact that the window is being shown as a problem."
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling
ClearAllCaches
cannot find any UI elements with image caches. I am also not sure if this issue related to dotnet/wpf#2158.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jack251970 and @onesounds Can you make sure that no new elements with BitmapCache are added after OnLoaded? Thank you.
As #3384 (comment) , what worries me is that elements are added dynamically, and they are added after loading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For second window, I do think there are any elements added dynamically. For main window, I think there could be some dynamically added elements if we change query text. But even if we do not change query text, the freezing issue still exists.