fix: popout/popup windows freeze when not focused#134
Open
Niketion wants to merge 1 commit into
Open
Conversation
…ndow freezing When a popup/popout window is focused, the main window stops updating visually, and vice versa. This happens because iced::window::frames() only emits frame events for the currently focused window. Replace it with iced::time::every(16ms) so all windows remain active and keep updating regardless of focus state.
Contributor
Author
|
After discussing this with @akenshaw, we reached the conclusion that this PR is not applicable for now. We’ll reconsider it at a later time root cause: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When a popup/popout window is focused, the main window stops updating visually, and vice versa. This makes the app feel broken when using multiple windows — whichever window isn't focused appears completely frozen.
Root Cause
The app tick/update loop uses
iced::window::frames(), which only emits frame events for the currently focused window. When focus moves to a popout, the main window stops receiving frame events and vice versa.Fix
Replace
iced::window::frames()withiced::time::every(Duration::from_millis(16))(~60fps), which fires on a wall-clock interval independent of window focus. All windows now keep updating regardless of which one is focused.Why 16ms
Matches roughly 60fps, consistent with the previous frame-driven behavior when a window was focused. The interval could be tuned further if needed (e.g. 33ms for ~30fps to reduce CPU usage).