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

Pass target and validated to ClientDnDGrabHandler::dropped() #1575

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion anvil/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl<BackendData: Backend> ClientDndGrabHandler for AnvilState<BackendData> {
};
self.dnd_icon = icon.map(|surface| DndIcon { surface, offset });
}
fn dropped(&mut self, _seat: Seat<Self>) {
fn dropped(&mut self, _target: Option<WlSurface>, _validated: bool, _seat: Seat<Self>) {
self.dnd_icon = None;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/wayland/selection/data_device/dnd_grab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ where
}
}

ClientDndGrabHandler::dropped(data, self.seat.clone());
ClientDndGrabHandler::dropped(data, self.current_focus.clone(), validated, self.seat.clone());
self.icon = None;
// in all cases abandon the drop
// no more buttons are pressed, release the grab
Expand Down
5 changes: 4 additions & 1 deletion src/wayland/selection/data_device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ pub trait ClientDndGrabHandler: SeatHandler + Sized {
///
/// Note that this event will only be generated for client-initiated drag'n'drop session.
///
/// * `target` - The target surface that the contents were dropped on.
/// * `validated` - Whether the drop offer was negotiated and accepted. If `false`, the drop
/// was cancelled or otherwise not successful.
/// * `seat` - The seat on which the DnD action was finished.
fn dropped(&mut self, seat: Seat<Self>) {}
fn dropped(&mut self, target: Option<WlSurface>, validated: bool, seat: Seat<Self>) {}
}

/// Event generated by the interactions of clients with a server initiated drag'n'drop
Expand Down
Loading