Still need to wire up MouseMove with the new regions

This commit is contained in:
Nathan Sobo 2023-08-18 02:23:06 -06:00
parent 3709eff34b
commit b910c85f7f
7 changed files with 82 additions and 33 deletions

View file

@ -1890,6 +1890,7 @@ impl AppContext {
fn handle_repaint_window_effect(&mut self, window: AnyWindowHandle) {
self.update_window(window, |cx| {
cx.layout(false).log_err();
if let Some(scene) = cx.paint().log_err() {
cx.window.platform_window.present_scene(scene);
}
@ -3655,12 +3656,6 @@ impl<'a, 'b, 'c, V: 'static> EventContext<'a, 'b, 'c, V> {
pub fn propagate_event(&mut self) {
self.handled = false;
}
pub fn repaint(&mut self) {
let window = self.window();
self.pending_effects
.push_back(Effect::RepaintWindow { window });
}
}
impl<'a, 'b, 'c, V> Deref for EventContext<'a, 'b, 'c, V> {

View file

@ -220,6 +220,12 @@ impl<'a> WindowContext<'a> {
}
}
pub fn repaint(&mut self) {
let window = self.window();
self.pending_effects
.push_back(Effect::RepaintWindow { window });
}
pub fn layout_engine(&mut self) -> Option<&mut LayoutEngine> {
self.window.layout_engines.last_mut()
}