1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

Replace uiless_pass flag with Context::is_visible

egui now derives "no ui is shown this pass" from the `minimized` /
`occluded` flags the integrations already report in `ViewportInfo`,
instead of a new `RawInput` flag that they had to set separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Emil Ernerfeldt
2026-08-04 17:02:10 +02:00
parent bb37c758c7
commit 51047205d8
9 changed files with 67 additions and 81 deletions

View File

@@ -268,14 +268,10 @@ impl EpiIntegration {
app: &mut dyn epi::App,
viewport_ui_cb: Option<&DeferredViewportUiCallback>,
mut raw_input: egui::RawInput,
show_ui: bool,
is_visible: bool,
) -> egui::FullOutput {
raw_input.time = Some(self.beginning.elapsed().as_secs_f64());
// We still run a pass while hidden so that app logic keeps ticking,
// but we tell egui to skip all book-keeping that assumes ui was shown:
raw_input.uiless_pass = !show_ui;
let close_requested = raw_input.viewport().close_requested();
app.raw_input_hook(&self.egui_ctx, &mut raw_input);
@@ -283,7 +279,7 @@ impl EpiIntegration {
let full_output = self.egui_ctx.run_ui(raw_input, |ui| {
if let Some(viewport_ui_cb) = viewport_ui_cb {
// Child viewport
if show_ui {
if is_visible {
profiling::scope!("viewport_callback");
viewport_ui_cb(ui);
}
@@ -293,7 +289,7 @@ impl EpiIntegration {
app.logic(ui.ctx(), &mut self.frame);
}
if show_ui {
if is_visible {
{
profiling::scope!("App::ui");
app.ui(ui, &mut self.frame);

View File

@@ -280,10 +280,6 @@ impl AppRunner {
.and_then(|v| v.visible())
.unwrap_or(true);
// We still run a pass while hidden so that app logic keeps ticking,
// but we tell egui to skip all book-keeping that assumes ui was shown:
raw_input.uiless_pass = !is_visible;
let full_output = self.egui_ctx.run_ui(raw_input, |ui| {
self.app.logic(ui.ctx(), &mut self.frame);