[V3] windows: fix html drag and drop#4259
Conversation
WalkthroughThe update modifies the drag-and-drop initialization logic in the Windows webview window implementation, ensuring that external drag is only allowed if drag-and-drop is enabled. It also adds a corresponding bug fix entry to the unreleased changelog, documenting the change. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
v3/pkg/application/webview_window_windows.go (1)
1716-1724: Consider cleaning up commented-out code.This commented block contains similar drag-and-drop functionality to what's implemented above. Since it's not being used, it's creating unnecessary code noise.
- // We will get round to this - //if chromium.HasCapability(edge.AllowExternalDrop) { - // err := chromium.AllowExternalDrag(w.parent.options.EnableDragAndDrop) - // if err != nil { - // globalApplication.handleFatalError(err) - // } - // if w.parent.options.EnableDragAndDrop { - // chromium.MessageWithAdditionalObjectsCallback = w.processMessageWithAdditionalObjects - // } - //}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
v3/pkg/application/webview_window_windows.go(1 hunks)
🔇 Additional comments (1)
v3/pkg/application/webview_window_windows.go (1)
1651-1656: Good fix - this resolves HTML drag and drop functionality while preserving Windows file drag and drop support.The change correctly moves the
AllowExternalDrag(false)call inside theEnableDragAndDropconditional block, which ensures that HTML drag and drop operations are only disabled for applications that explicitly need Windows-level file drag and drop support.Previously, HTML drag and drop was disabled for all applications regardless of whether they needed Windows file drag and drop, which caused the issue described in the PR.
|
|
|
I'm going to create a separate PR with a DnD refactor to bring it in line with v2. After some analysis last night, it seems that the window level DnD is just adding complexity and this can be achieved by making the body tag a drop zone so we'll remove it. |
|
I don't know if this is what you mean but there's #4318 that may or may not have to do with all this. |
|
* fix(windows): disable external drag only when EnableDragAndDrop is set * update changelog for html dnd fix * remove redundant commented out code for windows dnd * Fix changelog --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> Co-authored-by: Atterpac <89053530+atterpac@users.noreply.github.com>




Description
HTML drag and drop didn't work, and it looks like that's because
chromium.AllowExternalDrag(false)is being called on any and all apps. I found this issue which talks about disabling ExternalDrag for apps that want windows level file drag and drop, so I assume that's why that line is being called. For now, without further understanding windows level drag and drop I figured we can disable external drag only when the app should respect windows level drag and drop.I will add that the example for drag and drop worked even without disabling ExternalDrag, do we might not need this at all.
Fixes # (issue)
Type of change
Please select the option that is relevant.
How Has This Been Tested?
ran the two dnd examples in v3/examples
If you checked Linux, please specify the distro and version.
Test Configuration
Checklist:
website/src/pages/changelog.mdxwith details of this PRSummary by CodeRabbit
Bug Fixes
Documentation