gpui: Fix `send_file_drop_event` holding mutex during event callback (#50173)
Albab Hasan
created
`send_file_drop_event` was the only event dispatch site in window.rs
that called the event callback while still holding the `MacWindowState`
mutex. every other callback site in the file uses the established
`take() / drop(lock) / callback()` pattern which releases the lock
before invoking user code.
this is a latent code quality issue: no deadlock occurs today because
the current file-drop callback chain does not reenter `MacWindowState`'s
mutex (`Window::mouse_position()` returns a cached field
`Window::refresh()` only marks a dirty flag and `cx.activate()` uses a
separate `MacPlatform` mutex). but `parking_lot::Mutex` is not entering
so any future platform call added inside a filedrop handler would
deadlock immediately and silently.
the fix brings `send_file_drop_event` in line with the rest of the file
by taking the callback out of the state dropping the lock invoking the
callback then reacquiring the lock to restore the callback and update
state.
Release Notes:
- N/A