-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Enable power saving mode back in the editor on Linux #567
Comments
There may be a way to create a minimal working example in pure winit in order to report this bug to winit team, but until now, I am not able to reproduce this bug in pure winit. So I put the codes here. If anyone can make a minimal example and reproduce the bug, please report to winit's github.
|
I guess we (you 😅 ) should also try use winit::{
event::Event,
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
fn main() {
let event_loop = EventLoop::new().unwrap();
let window = WindowBuilder::new().build(&event_loop).unwrap();
let mut counter = 300;
event_loop
.run(move |event, elwt| {
if let Event::AboutToWait = event {
if counter > 0 {
window.request_redraw();
counter -= 1;
}
}
if counter > 0 {
elwt.set_control_flow(ControlFlow::Poll);
} else {
elwt.set_control_flow(ControlFlow::Wait);
}
})
.unwrap();
} This is the closest code to what the editor does on startup. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Power-saving mode is disabled on Linux for now because of a subtle bug in
winit
which cannot handle control flow juggling properly on Wayland causing the editor to crash. This is mostly a tracking issue.The text was updated successfully, but these errors were encountered: