Skip to content

Commit

Permalink
Changes as per linebender#831 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoshid committed Apr 26, 2020
1 parent f27be6f commit 818d36d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion druid/src/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use crate::{
Affine, Command, Cursor, Insets, Point, Rect, Size, Target, Text, TimerToken, WidgetId,
WindowHandle, WindowId,
};
use std::collections::HashMap;

/// A mutable context provided to event handling methods of widgets.
///
Expand Down
4 changes: 2 additions & 2 deletions druid/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
recurse = had_active || child_ctx.base_state.is_hot;
Event::Zoom(*zoom)
}
Event::Timer(id) => {
panic!("We cannot be here");
Event::Timer(token) => {
Event::Timer(*token)
}
Event::Command(cmd) => Event::Command(cmd.clone()),
};
Expand Down
4 changes: 2 additions & 2 deletions druid/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ impl<T: Data> Window<T> {

self.post_event_processing(queue, data, env, false);

if let Event::Timer(t) = event {
self.timers.remove(&t);
if let Event::Internal(InternalEvent::RouteTimer(token, _)) = event {
self.timers.remove(&token);
}

//If at least one widget requested timer, collect those timers from widgets and add to window's timers map.
Expand Down

0 comments on commit 818d36d

Please sign in to comment.