mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Fix flickering for Context::create_viewport_sync but now will return a Option<T>
This commit is contained in:
@@ -1096,10 +1096,8 @@ mod glow_integration {
|
|||||||
.and_then(|w| w.read().window.clone())
|
.and_then(|w| w.read().window.clone())
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
render(&egui_ctx);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2071,10 +2069,8 @@ mod wgpu_integration {
|
|||||||
*focused.read(),
|
*focused.read(),
|
||||||
|id| _windows.read().get(&id).and_then(|w| w.0.clone()),
|
|id| _windows.read().get(&id).and_then(|w| w.0.clone()),
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
render(&egui_ctx);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -615,10 +615,10 @@ impl<'open> Window<'open> {
|
|||||||
ctx.request_repaint_viewport(ctx.get_parent_viewport_id());
|
ctx.request_repaint_viewport(ctx.get_parent_viewport_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(InnerResponse {
|
InnerResponse {
|
||||||
inner: content_inner,
|
inner: content_inner,
|
||||||
response: full_response,
|
response: full_response,
|
||||||
})
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2289,7 +2289,7 @@ impl Context {
|
|||||||
&self,
|
&self,
|
||||||
viewport_builder: ViewportBuilder,
|
viewport_builder: ViewportBuilder,
|
||||||
func: impl FnOnce(&Context) -> T,
|
func: impl FnOnce(&Context) -> T,
|
||||||
) -> T {
|
) -> Option<T> {
|
||||||
if !self.force_embedding() {
|
if !self.force_embedding() {
|
||||||
let mut viewport_id = ViewportId::MAIN;
|
let mut viewport_id = ViewportId::MAIN;
|
||||||
let mut parent_viewport_id = ViewportId::MAIN;
|
let mut parent_viewport_id = ViewportId::MAIN;
|
||||||
@@ -2326,9 +2326,9 @@ impl Context {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
out.unwrap()
|
out
|
||||||
} else {
|
} else {
|
||||||
func(self)
|
Some(func(self))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user