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

Impl drag-drop action for Windows #8959

Merged
merged 6 commits into from
Mar 7, 2024

Conversation

JunkuiZhang
Copy link
Contributor

Description

This is a part of #8809

default.mp4

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 6, 2024
@mikayla-maki mikayla-maki self-assigned this Mar 6, 2024
crates/gpui/src/platform/windows/window.rs Outdated Show resolved Hide resolved
crates/gpui/src/platform/windows/window.rs Outdated Show resolved Hide resolved
crates/gpui/src/platform/windows/window.rs Outdated Show resolved Hide resolved
crates/gpui/src/platform/windows/window.rs Outdated Show resolved Hide resolved
let dragdrop_handler = {
let inner = context.inner.as_ref().unwrap();
let handler = WindowsDragDropHandler(Rc::clone(inner));
let dragdrop_handler: IDropTarget = handler.into();
Copy link
Contributor

Choose a reason for hiding this comment

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

dragdrop -> drag_drop

crates/gpui/src/platform/windows/window.rs Outdated Show resolved Hide resolved
crates/gpui/src/platform/windows/window.rs Outdated Show resolved Hide resolved
@@ -926,3 +1084,6 @@ unsafe fn set_window_long(hwnd: HWND, nindex: WINDOW_LONG_PTR_INDEX, dwnewlong:
SetWindowLongW(hwnd, nindex, dwnewlong as i32) as isize
}
}

const DRAGDROP_GET_COUNT: u32 = 0xFFFFFFFF;
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this constant come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay, it was 2 am when I submitted this PR.

By Microsoft:

If the value of this parameter is 0xFFFFFFFF, DragQueryFile returns a count of the files dropped.

@mikayla-maki
Copy link
Contributor

Looks great! If you could resolve some naming and comment issues + get the PR to passing CI and mergable, we can get this in :)

- rename `dragdrop` to `drag_drop`
- prefix `_` with some params
@JunkuiZhang
Copy link
Contributor Author

The spelling check complains about ptd, which is FORMATETC { ptd: .. ,}

@a-usr
Copy link
Contributor

a-usr commented Mar 7, 2024

You could suppress this warning as documented here

@mikayla-maki mikayla-maki merged commit b50f867 into zed-industries:main Mar 7, 2024
8 checks passed
@JunkuiZhang JunkuiZhang deleted the drag-drop branch April 10, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants