Skip to content

Windows: High CPU Usage when minimized #3982

@SitiSchu

Description

@SitiSchu

Describe the bug
When minimized a simple egui application will use up to 17% CPU on my CPU while using 0% when not minimized

To Reproduce
Steps to reproduce the behavior:

  1. Take a very simple egui application:
use eframe::egui;

fn main() -> Result<(), eframe::Error> {
    let options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
        ..Default::default()
    };

    eframe::run_simple_native("My egui App", options, move |ctx, _frame| {
        egui::CentralPanel::default().show(ctx, |ui| {
            ui.heading("My egui Application");
        });
    })
}
  1. Run it
  2. Observe CPU usage while open, if the mouse cursor is not in the window it will drop to 0
  3. Minimize window
  4. CPU Usage will go up a lot

Expected behavior
CPU Usage should stay low or at least close to the same CPU Usage when not minized

Screenshots
When idle and not minimized:
image
After being minimized:
image

Desktop:

  • OS: Windows 10 21H2 (19044.3086)
  • Version: latest master (56bf8b7)

Additional context
This does not happen with 0.25

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions