@@ -1,7 +1,7 @@
use crate::{
px, size, Action, AnyBox, AnyDrag, AnyView, AppContext, AsyncWindowContext, AvailableSpace,
- Bounds, BoxShadow, Context, Corners, DevicePixels, DispatchContext, DisplayId, ExternalPaths,
- Edges, Effect, Element, EntityId, EventEmitter, FileDropEvent, FocusEvent, FontId,
+ Bounds, BoxShadow, Context, Corners, DevicePixels, DispatchContext, DisplayId, Edges, Effect,
+ Element, EntityId, EventEmitter, ExternalPaths, FileDropEvent, FocusEvent, FontId,
GlobalElementId, GlyphId, Handle, Hsla, ImageData, InputEvent, IsZero, KeyListener, KeyMatch,
KeyMatcher, Keystroke, LayoutId, MainThread, MainThreadOnly, Modifiers, MonochromeSprite,
MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Path, Pixels, PlatformAtlas,
@@ -899,6 +899,7 @@ impl<'a, 'w> WindowContext<'a, 'w> {
}
InputEvent::FileDrop(file_drop) => match file_drop {
FileDropEvent::Entered { position, files } => {
+ self.window.mouse_position = position;
self.active_drag.get_or_insert_with(|| AnyDrag {
drag_handle_view: None,
cursor_offset: position,
@@ -912,17 +913,23 @@ impl<'a, 'w> WindowContext<'a, 'w> {
modifiers: Modifiers::default(),
})
}
- FileDropEvent::Pending { position } => InputEvent::MouseMove(MouseMoveEvent {
- position,
- pressed_button: Some(MouseButton::Left),
- modifiers: Modifiers::default(),
- }),
- FileDropEvent::Submit { position } => InputEvent::MouseUp(MouseUpEvent {
- button: MouseButton::Left,
- position,
- modifiers: Modifiers::default(),
- click_count: 1,
- }),
+ FileDropEvent::Pending { position } => {
+ self.window.mouse_position = position;
+ InputEvent::MouseMove(MouseMoveEvent {
+ position,
+ pressed_button: Some(MouseButton::Left),
+ modifiers: Modifiers::default(),
+ })
+ }
+ FileDropEvent::Submit { position } => {
+ self.window.mouse_position = position;
+ InputEvent::MouseUp(MouseUpEvent {
+ button: MouseButton::Left,
+ position,
+ modifiers: Modifiers::default(),
+ click_count: 1,
+ })
+ }
FileDropEvent::Exited => InputEvent::MouseUp(MouseUpEvent {
button: MouseButton::Left,
position: Point::default(),