Skip to content
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

Immediate viewport would crash with ViewportBuilder settings fullscreen + transparent + always_on_top #4091

Open
wangxiaochuTHU opened this issue Feb 23, 2024 · 1 comment
Labels
bug Something is broken viewports multiple viewports, viewports API

Comments

@wangxiaochuTHU
Copy link
Contributor

Describe the bug
The whole app would crash when showing a Immediate viewport with fullscreen + transparent + always_on_top set true simultaneously.

To Reproduce

Just set the ViewportBuilder to enable fullscreen + transparent + always_on_top all together, and the whole app would crash.

PS: The crash would happen ONLY WHEN these THREE attributes are enabled AT THE SAME TIME.

impl eframe::App for MyApp {
    fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
            ctx.show_viewport_immediate(
                egui::ViewportId::from_hash_of("immediate_viewport"),
                egui::ViewportBuilder::default()
                    .with_fullscreen(self.fullscreen)
                    .with_transparent(true)
                    .with_always_on_top(),
                |ctx, class| {
                    assert!(
                        class == egui::ViewportClass::Immediate,
                        "This egui backend doesn't support multiple viewports"
                    );
                },
            );
   }
}

Expected behavior
No crash.

Desktop (please complete the following information):

  • OS: Windows
  • Version 0.26.2
@wangxiaochuTHU

This comment was marked as abuse.

@emilk emilk added the viewports multiple viewports, viewports API label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken viewports multiple viewports, viewports API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants