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
Open
@Abestanis

Description

@Abestanis

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

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

      0