Skip to content

Pass mouse events through to WKWebView when EnableFileDrop:true#5772

Open
Etesam913 wants to merge 1 commit into
wailsapp:masterfrom
Etesam913:fix-no-hover-events-when-enableFileDrop
Open

Pass mouse events through to WKWebView when EnableFileDrop:true#5772
Etesam913 wants to merge 1 commit into
wailsapp:masterfrom
Etesam913:fix-no-hover-events-when-enableFileDrop

Conversation

@Etesam913

@Etesam913 Etesam913 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

Hover effects now get applied to windows where EnableFileDrop is set to true.

See how the hover effect of orange background gets applied when the change is made

Untitled.video.mp4

Fixes #5771

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

If you checked Linux, please specify the distro and version.

Test Configuration

wails3 doctor                                                                                           wails
Wails v3.0.0-alpha2.117 › Wails Doctor

# System

┌────────────────────────────┐
| Name          | MacOS      |
| Version       | 27.0       |
| ID            | 26A5378j   |
| Branding      | MacOS 27.0 |
| Platform      | darwin     |
| Architecture  | arm64      |
| Apple Silicon | true       |
| CPU           | Apple M2   |
| CPU           | Apple M2   |
| GPU           | 10 cores   |
| Memory        | 24 GB      |
└────────────────────────────┘

# Build Environment

┌──────────────────────────────────┐
| Wails CLI    | v3.0.0-alpha2.117 |
| Go Version   | go1.25.12         |
| -buildmode   | exe               |
| -compiler    | gc                |
| CGO_CFLAGS   |                   |
| CGO_CPPFLAGS |                   |
| CGO_CXXFLAGS |                   |
| CGO_ENABLED  | 1                 |
| CGO_LDFLAGS  |                   |
| GOARCH       | arm64             |
| GOARM64      | v8.0              |
| GOOS         | darwin            |
└──────────────────────────────────┘

# Dependencies

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| *Android SDK       | Not found. Set ANDROID_HOME (install via Android Studio or the command-line tools). |
| *NSIS              | Not Installed. Install with `brew install makensis`.                                |
| *Xcode (iOS)       | Xcode 26.1, Build version 17B55                                                     |
| *iOS Device SDK    | 26.1                                                                                |
| *iOS Simulator SDK | 26.1                                                                                |
| Xcode cli tools    | 2417                                                                                |
| npm                | 11.4.2                                                                              |
| docker             | *Not installed (optional - for cross-compilation)                                   |
|                                                                                                          |
└──────────────────────────────────────── * - Optional Dependency ─────────────────────────────────────────┘

# Signing

┌────────────────────────────────────────┐
| macOS Signing   | Not configured       |
| Windows Signing | Not configured       |
| Linux Signing   | Not configured (GPG) |
└────────────────────────────────────────┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 SUCCESS  Your system is ready for Wails development!

Need documentation? Run: wails3 docs
 ♥   If Wails is useful to you or your company, please consider sponsoring the project: wails3 sponsor

Checklist:

  • (v2 only) I have updated website/src/pages/changelog.mdx with details of this PR (v3 changelog entries are added automatically)
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes
    • Improved mouse-event handling for webview-based windows.
    • Mouse interactions can now pass through the drag area to the underlying webview while preserving existing drag-and-drop behavior.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f34f79e6-db12-4d99-a430-dc724f9b5dbb

📥 Commits

Reviewing files that changed from the base of the PR and between 3440ae5 and 4f0e5ed.

📒 Files selected for processing (1)
  • v3/pkg/application/webview_window_darwin_drag.m

Walkthrough

WebviewDrag now returns nil from hitTest:, allowing mouse events to pass through to the underlying WKWebView while retaining existing drag-and-drop behavior.

Changes

macOS drag event handling

Layer / File(s) Summary
Pass-through hit testing
v3/pkg/application/webview_window_darwin_drag.m
WebviewDrag overrides hitTest: to return nil, allowing hover, cursor, and mouse-movement events to reach the underlying WKWebView.

Estimated code review effort: 2 (Simple) | ~5 minutes

Poem

I’m a bunny who hops through the view,
Letting mouse events pass cleanly through.
Drag paths remain, while hovers grow bright,
With hitTest: yielding out of sight.
Wiggle and drop—everything’s right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the fix: passing mouse events through to WKWebView when EnableFileDrop is enabled.
Description check ✅ Passed The description includes the issue link, change summary, type, testing details, and checklist items required by the template.
Linked Issues check ✅ Passed The change directly addresses #5771 by allowing mouse events to reach WKWebView so hover events work again.
Out of Scope Changes check ✅ Passed The PR stays focused on the reported macOS hover issue and introduces no unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[V3] Hover events do not trigger in window when EnableFileDrop:true is set

1 participant