Skip to content

Commit

Permalink
refactor(ribir): 💡 remove DynWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Adoo committed Aug 26, 2023
1 parent cc71c71 commit a06dc9a
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 154 deletions.
7 changes: 3 additions & 4 deletions core/src/test_helper.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::timer::Timer;
pub use crate::timer::Timer;
use std::{
rc::Rc,
sync::atomic::{AtomicU64, Ordering},
Expand All @@ -22,8 +22,8 @@ pub struct TestWindow(pub Rc<Window>);
#[macro_export]
macro_rules! reset_test_env {
() => {
let _ = rxrust::scheduler::NEW_TIMER_FN.set(Timer::new_timer_future);
let _guard = unsafe { AppCtx::new_lock_scope() };
let _ = $crate::prelude::NEW_TIMER_FN.set(Timer::new_timer_future);
let _guard = unsafe { $crate::prelude::AppCtx::new_lock_scope() };
};
}

Expand Down Expand Up @@ -76,7 +76,6 @@ impl TestWindow {
pub fn draw_frame(&mut self) {
// Test window not have a eventloop, manually wake-up every frame.
Timer::wake_timeout_futures();
AppCtx::run_until_stalled();
self.run_frame_tasks();

self.0.draw_frame();
Expand Down
1 change: 0 additions & 1 deletion core/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ impl Window {
pub fn processes_native_event(&self, event: WindowEvent) {
let ratio = self.device_pixel_ratio() as f64;
self.dispatcher.borrow_mut().dispatch(event, ratio);
self.run_frame_tasks();
}

/// Request switch the focus to next widget.
Expand Down
1 change: 1 addition & 0 deletions ribir/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ impl App {
wnd.processes_native_event(event);
}
}
wnd.run_frame_tasks();
}
Event::MainEventsCleared => {
AppCtx::run_until_stalled();
Expand Down
Loading

0 comments on commit a06dc9a

Please sign in to comment.