1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Fix Context::is_pointer_over_egui and Context::egui_wants_pointer_input (#8081)

* Closes https://github.com/emilk/egui/issues/8041

These functions were broken when using the new `run_ui`.
This commit is contained in:
Emil Ernerfeldt
2026-04-08 09:52:28 +02:00
committed by GitHub
parent 1fdc5c0775
commit b117a1ac19
4 changed files with 83 additions and 18 deletions

View File

@@ -13,7 +13,8 @@ workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
eframe = { workspace = true, features = [
eframe = { workspace = true, default_features = false, features = [
"glow",
"default",
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }

View File

@@ -30,6 +30,10 @@ struct MyTestApp {}
impl eframe::App for MyTestApp {
fn ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) {
egui::Panel::top("top").show_inside(ui, |ui| {
ui.label("This is a test of painting directly with glow.");
});
use glow::HasContext as _;
let gl = frame.gl().unwrap();
@@ -43,6 +47,21 @@ impl eframe::App for MyTestApp {
egui::Window::new("Floating Window").show(ui.ctx(), |ui| {
ui.label("The background should be purple.");
ui.label(format!(
"is_pointer_over_egui: {}",
ui.is_pointer_over_egui()
));
ui.label(format!(
"egui_wants_pointer_input: {}",
ui.egui_wants_pointer_input()
));
ui.label(format!(
"egui_is_using_pointer: {}",
ui.egui_is_using_pointer()
));
if let Some(pos) = ui.pointer_latest_pos() {
ui.label(format!("layer_id_at: {:?}", ui.layer_id_at(pos)));
}
});
}
}