-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
base: dev
Are you sure you want to change the base?
Fix freezing with gpu #3384
Conversation
This comment has been minimized.
This comment has been minimized.
Flow.Launcher/MainWindow.xaml.cs
Outdated
@@ -236,6 +236,7 @@ private async void OnLoaded(object sender, RoutedEventArgs _) | |||
DependencyPropertyDescriptor | |||
.FromProperty(VisibilityProperty, typeof(StackPanel)) // History는 StackPanel이라고 가정 | |||
.AddValueChanged(History, (s, e) => UpdateClockPanelVisibility()); | |||
_viewModel.ClearAllCacheModes(this); |
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.
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.
ClearAllCacheModes cannot bring any difference.
@Jack251970 I not sure this issus is same as dotnet/wpf#2158 . Maybe other case cause the freeze render issues.
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 This issue basically comes down to the fact that the freeze gets lifted when the primary window is shown. So the behavior you're describing is actually expected. What’s happening is that when the primary window is hidden, something keeps trying to render to it, and that’s causing the second window (in our case, the settings window) to crash.
Sorry for my confusion. I mean the second window starts to work when I brought main window with hotkey.
Open FL -> Sleep -> Unlock -> Open settings window (Freeze) -> Open main window with hotkey (Settings window starts to render)
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."
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.
ClearAllCacheModes cannot bring any difference.
@Jack251970 I not sure this issus is same as dotnet/wpf#2158 . Maybe other case cause the freeze render issues.
Calling ClearAllCaches
cannot find any UI elements with image caches. I am also not sure if this issue related to 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.
@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.
@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.
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. Forbidden patterns 🙅 (1)In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves. These forbidden patterns matched content: s.b. workaround(s)
If the flagged items are 🤯 false positivesIf items relate to a ...
|
Reference
TODO