Checkpoint
This commit is contained in:
parent
a9c69bf774
commit
a69dbafe3c
4 changed files with 13 additions and 8 deletions
|
@ -909,7 +909,7 @@ impl<'a, 'w, S: Send + Sync + 'static> ViewContext<'a, 'w, S> {
|
|||
let window_handle = self.window.handle;
|
||||
self.app.observers.insert(
|
||||
handle.id,
|
||||
Arc::new(move |cx| {
|
||||
Box::new(move |cx| {
|
||||
cx.update_window(window_handle.id, |cx| {
|
||||
if let Some(handle) = handle.upgrade(cx) {
|
||||
this.update(cx, |this, cx| on_notify(this, handle, cx))
|
||||
|
@ -936,7 +936,7 @@ impl<'a, 'w, S: Send + Sync + 'static> ViewContext<'a, 'w, S> {
|
|||
let window_handle = self.window.handle;
|
||||
self.app.event_handlers.insert(
|
||||
handle.id,
|
||||
Arc::new(move |event, cx| {
|
||||
Box::new(move |event, cx| {
|
||||
cx.update_window(window_handle.id, |cx| {
|
||||
if let Some(handle) = handle.upgrade(cx) {
|
||||
let event = event.downcast_ref().expect("invalid event type");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue