We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using following code, after closing window, CPU shoots up to 95%. Doesn't happen every time. Tested macOS and Linux
use iced::widget::text_input; use iced::window; use iced::{Element, Task}; fn main() -> iced::Result { iced::daemon("High CPU", Example::update, Example::view) .run_with(Example::new) } struct Example; #[derive(Debug, Clone)] enum Message { WindowOpened(window::Id), } impl Example { fn new() -> (Self, Task<Message>) { let (_id, open) = window::open(window::Settings::default()); ( Self, open.map(Message::WindowOpened), ) } fn update(&mut self, message: Message) -> Task<Message> { match message { Message::WindowOpened(id) => { text_input::focus(format!("input-{id}")) } } } fn view(&self, window_id: window::Id) -> Element<Message> { text_input("Input", "Value") .id(format!("input-{window_id}")) .into() } }
On macOS I tracked it down to os creating a lot of kCFRunLoopAfterWaiting events here and the app is getting a spammed with following events
kCFRunLoopAfterWaiting
NewEvents(ResumeTimeReached { start: Instant { tv_sec: 1936325, tv_nsec: 582125083 }, requested_resume: Instant { tv_sec: 1936321, tv_nsec: 90415500 } }) NewEvents(ResumeTimeReached { start: Instant { tv_sec: 1936325, tv_nsec: 582146958 }, requested_resume: Instant { tv_sec: 1936321, tv_nsec: 90415500 } }) NewEvents(ResumeTimeReached { start: Instant { tv_sec: 1936325, tv_nsec: 582169166 }, requested_resume: Instant { tv_sec: 1936321, tv_nsec: 90415500 } }) NewEvents(ResumeTimeReached { start: Instant { tv_sec: 1936325, tv_nsec: 582355291 }, requested_resume: Instant { tv_sec: 1936321, tv_nsec: 90415500 } })
It seems to be happening on both released 0.13 and master branch
CPU usage stays close to 0%
master
macOS and Linux
No response
The text was updated successfully, but these errors were encountered:
Use single window and hide/unhide it, instead of recreating window ea…
532cd3e
…ch time This is a workaround for iced-rs/iced#2719
No branches or pull requests
Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
What happened?
Using following code, after closing window, CPU shoots up to 95%. Doesn't happen every time. Tested macOS and Linux
On macOS I tracked it down to os creating a lot of
kCFRunLoopAfterWaiting
events here and the app is getting a spammed with following eventsIt seems to be happening on both released 0.13 and master branch
What is the expected behavior?
CPU usage stays close to 0%
Version
master
Operating System
macOS and Linux
Do you have any log output?
No response
The text was updated successfully, but these errors were encountered: