-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to request a redraw from an external source #12197
Changes from 2 commits
ad6332c
dc9e2dc
6b6e508
c7b8413
cf7343f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,8 @@ use winit::{ | |
event_loop::{ControlFlow, EventLoop, EventLoopBuilder, EventLoopWindowTarget}, | ||
}; | ||
|
||
pub use winit::event_loop::EventLoopProxy; | ||
|
||
use crate::accessibility::{AccessKitAdapters, AccessKitPlugin, WinitActionHandlers}; | ||
|
||
use crate::converters::convert_winit_theme; | ||
|
@@ -698,6 +700,9 @@ fn handle_winit_event( | |
event_loop.set_control_flow(ControlFlow::Wait); | ||
} | ||
} | ||
Event::UserEvent(_) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you expose a specific type that should be sent to trigger a redraw rather than match on anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I replaced the type with RequestRedraw. Also the reexport is now a type alias which prevents someone from using the wrong generic parameter when requesting the resource |
||
runner_state.redraw_requested = true; | ||
} | ||
_ => (), | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it'd be nice to have some documentation pointing users to this pattern somewhere. Maybe on
WinitSettings::desktop_app
? Or maybe there's a better place for it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, i added some documentation. I also added it to the bullet points of
Reactive
andReactiveLowPower