emilk / emilk/egui

Immediate viewport would crash with ViewportBuilder settings `fullscreen` + `transparent` + `always_on_top`

Open
#4,091 1 comment 2 reactions 0 assignees View on GitHub
bug viewports
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 12h
Merged PRs (30d)
67

Description

**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**.

```rust
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.