Merge remote-tracking branch 'origin/main' into perf-2

This commit is contained in:
Nathan Sobo 2023-12-14 16:56:36 -07:00
commit 02606d1fb9
34 changed files with 822 additions and 1270 deletions

View file

@ -822,7 +822,7 @@ impl<'a> WindowContext<'a> {
/// a specific need to register a global listener.
pub fn on_mouse_event<Event: 'static>(
&mut self,
handler: impl Fn(&Event, DispatchPhase, &mut WindowContext) + 'static,
mut handler: impl FnMut(&Event, DispatchPhase, &mut WindowContext) + 'static,
) {
let order = self.window.next_frame.z_index_stack.clone();
self.window
@ -1400,6 +1400,7 @@ impl<'a> WindowContext<'a> {
self.window.mouse_position = position;
if self.active_drag.is_none() {
self.active_drag = Some(AnyDrag {
value: Box::new(files.clone()),
view: self.build_view(|_| files).into(),
cursor_offset: position,
});