Skip to content

Commit

Permalink
fix: call ctx.drop_finish in webkit2gtk drop handler (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Nov 8, 2024
1 parent 7c4f2b7 commit 9a2a2d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/gnome-dragged-icon-stuck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": "patch"
---

Fix icons of dragged items getting stuck when using `WebViewBuilder::with_drag_drop_handler` on some distros like Gnome.
3 changes: 2 additions & 1 deletion src/webkitgtk/drag_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ pub(crate) fn connect_drag_event(webview: &WebView, handler: Box<dyn Fn(DragDrop

{
let controller = controller.clone();
webview.connect_drag_drop(move |_, _, x, y, _| {
webview.connect_drag_drop(move |_, ctx, x, y, time| {
if controller.has_entered() {
if let Some(paths) = controller.take_paths() {
ctx.drop_finish(true, time);
controller.leave();
return controller.call(DragDropEvent::Drop {
paths,
Expand Down

0 comments on commit 9a2a2d4

Please sign in to comment.