mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
egui-winit: don't repaint when just moving window (#1980)
* Bug fix: reset repaint countdown when we pass it * eframe: debug-print what winit event caused a repaint * egui-winit: don't repaint when only moving window * fix docstring
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
pub use egui_winit;
|
||||
pub use egui_winit::EventResponse;
|
||||
|
||||
use egui_winit::winit;
|
||||
|
||||
/// Use [`egui`] from a [`glow`] app based on [`winit`].
|
||||
@@ -31,13 +33,7 @@ impl EguiGlow {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if egui wants exclusive use of this event
|
||||
/// (e.g. a mouse click on an egui window, or entering text into a text field).
|
||||
/// For instance, if you use egui for a game, you want to first call this
|
||||
/// and only when this returns `false` pass on the events to your game.
|
||||
///
|
||||
/// Note that egui uses `tab` to move focus between elements, so this will always return `true` for tabs.
|
||||
pub fn on_event(&mut self, event: &winit::event::WindowEvent<'_>) -> bool {
|
||||
pub fn on_event(&mut self, event: &winit::event::WindowEvent<'_>) -> EventResponse {
|
||||
self.egui_winit.on_event(&self.egui_ctx, event)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user