8000 `with_maximized` causes a second window to flash and close on startup before the main window opens · Issue #5975 · emilk/egui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

with_maximized causes a second window to flash and close on startup before the main window opens #5975

New issue

< 8000 strong>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

Open
Abestanis opened this issue Apr 11, 2025 · 0 comments
Labels
bug Something is broken

Comments

@Abestanis
Copy link
Abestanis commented Apr 11, 2025

Describe the bug
When using the with_maximized(true) option on the ViewportBuilder, There is a small flash when the application is started. This can be sometimes very noticeable or sometimes not at all, it depends on the computer speed. This means it's not noticeable when I plug my laptop into power, somewhat noticeable when it's on battery, and very noticeable on my older laptop which is slower.

I recorded the behavior in front of a black fullscreen window at 10% speed:
Flicker at startup

Mp4 Video

maximised.mp4

To Reproduce
Steps to reproduce the behavior:

  1. Compile and run the following example:
    #!/usr/bin/env cargo
    ---
    [dependencies]
    eframe = { git = "https://github.com/emilk/egui", branch = "master" }
    ---
    
    use eframe::{
        egui::{CentralPanel, Context, ViewportBuilder},
        run_native, App, Frame, NativeOptions, Result,
    };
    
    struct Ui {}
    
    impl App for Ui {
        fn update(&mut self, ctx: &Context, _frame: &mut Frame) {
            let _response = CentralPanel::default().show(ctx, |_ui| {});
        }
    }
    
    fn main() -> Result<()> {
        run_native(
            "Maximised",
            NativeOptions {
                viewport: ViewportBuilder::default().with_maximized(true),
                ..Default::default()
            },
            Box::new(|_creation_context| Ok(Box::new(Ui {}))),
        )
    }
  2. See window flicker on start.

Expected behavior
No flickering at the start.

Desktop (please complete the following information):

  • OS: Windows 11 (Version 10.0.26100.3476)
  • Browser: NA
  • Version: NA
@Abestanis Abestanis added the bug Something is broken label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant
0