Skip to content
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

Drag and drop #148

Merged
merged 20 commits into from
Jun 18, 2023
Merged

Drag and drop #148

merged 20 commits into from
Jun 18, 2023

Conversation

ilmai
Copy link
Contributor

@ilmai ilmai commented Jun 5, 2023

Only implemented for Windows for now

src/win/window.rs Outdated Show resolved Hide resolved
src/win/window.rs Outdated Show resolved Hide resolved
src/win/window.rs Outdated Show resolved Hide resolved
src/win/window.rs Outdated Show resolved Hide resolved
src/win/window.rs Outdated Show resolved Hide resolved
src/win/window.rs Outdated Show resolved Hide resolved
ilmai added 8 commits June 10, 2023 21:52
Instead of working around the winapi bug by manually parsing the pointer we're (incorrectly) given, use the correct function signature and transmute the function pointer
- WindowState no longer holds a reference to DropTarget
- DropTarget is passed to RegisterDragDrop() with Rc::into_raw() instead of Rc::as_ptr() so it keeps the reference
- WindowState is created with Rc instead of Box so DropTarget can hold a Rc to it
We were leaking the DropTarget, so WindowState holds a reference to DropTarget again, so it can be dropped when the window is destroyed. Also, DropTarget now holds a Weak reference to WindowState and that's taken into account in callbacks.
@ilmai ilmai requested a review from micahrj June 10, 2023 20:21
Copy link
Member

@micahrj micahrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

src/win/drop_target.rs Show resolved Hide resolved
@micahrj micahrj merged commit 1d9806d into RustAudio:master Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants