Skip to content

Add Explorer Nav DragOver Fix mod (nav hover-expand jump + wheel during drag)#4192

Merged
m417z merged 8 commits into
ramensoftware:mainfrom
tonythethompson:add-explorer-nav-dragover-fix
Jun 1, 2026
Merged

Add Explorer Nav DragOver Fix mod (nav hover-expand jump + wheel during drag)#4192
m417z merged 8 commits into
ramensoftware:mainfrom
tonythethompson:add-explorer-nav-dragover-fix

Conversation

@tonythethompson
Copy link
Copy Markdown
Contributor

@tonythethompson tonythethompson commented May 27, 2026

Summary

Adds Explorer Nav DragOver Fix (explorer-nav-dragover-fix) for explorer.exe.

  • Fixes two long-standing File Explorer drag-and-drop annoyances that stock Explorer don’t address together: nav-pane jump on hover-expand and mouse-wheel input swallowed during drag. One mod, both panes, drag stays alive.

  • Jump on hover-expand — Dragging over top-level nav items (drives, pinned folders, “This PC”) triggers auto-expand; Explorer often scrolls the pane and the row you were aiming at disappears. The mod pins the first visible item and keeps the drop highlight on the captured parent row until the cursor leaves that row. Deeper folders still expand normally without the anchor.

  • Wheel during drag — Restores vertical (and horizontal) wheel scrolling over the left navigation tree and the right file area while a drag is active, so you can reach off-screen drop targets without releasing. Optional setting restores native no-scroll behavior.

  • Demo: explorer-nav-dragover-fix-demo.gif (submitter fork)

Notes for reviewers

  • No existing Windhawk mod targets this combination. Related discussion: blocking programmatic nav expand (windhawk-mods#3789) — this mod instead fixes drag-hover scroll jump and wheel during drag.
  • File-pane scrolling deliberately does not post wheel/scroll messages to SHELLDLL_DefView during DoDragDrop — that path scrolled in early testing but ended the drag. Production path uses UI Automation ScrollPattern on the content host (Win11 Details / ItemsView / DirectUI on 25H2), with SendMessageTimeout wheel only as fallback on the host — including classic SysListView32 (Large icons / List) after UIA is tried first.

Implementation notes

  • DoDragDrop hook — drag generation + per-thread WH_MOUSE for the modal drag loop.
  • Nav anti-jump — SetWindowSubclass on nav SysTreeView32; intercepts/lies selected TVM_* / timed WM_VSCROLL swallow after suppressed jumps; EVENT_OBJECT_CREATE helper thread for new cabinets.
  • Wheel forwarding — WM_MOUSEWHEEL / WM_MOUSEHWHEEL to target under cursor:
    Nav: SysTreeView32 when over the tree.
  • File pane: resolve SHELLDLL_DefView + smallest content host (UIItemsView / ItemsView / DirectUIHWND / SysListView32); scroll via UIA when available; per-drag caches for target + scroll pattern; COM initialized on the drag thread for UIA.
  • The ‘scroll but cancel drag’ failure mode for DefView took a while to find; UIA on the content host is the stable fix on 25H2 Details.
  • All state scoped to the active drag (no persistence between drags).

Testing

  • Windows 11 (23H2 / 24H2 / 25H2 build 26200.x), File Explorer.
  • Nav: stable hover + highlight on protected depths; no jump when hovering drives / pinned / “This PC”; deeper levels unchanged.
  • Wheel (setting on): scroll nav tree and file pane during drag without dropping; Details (ItemsView) and Large icons / List (SysListView32) exercised.
  • Wheel (setting off): native behavior (wheel still swallowed during drag).

Changelog

New mod — initial release 1.1.9.

  • Initial release: anti-jump anchoring for shallow nav depths, wheel forwarding during drag in nav pane + main file list pane, configurable depth/thresholds.

Mod authorship

This mod was created by:

  • The submitter, without AI assistance
  • The submitter, with AI assistance
  • Claude
  • ChatGPT
  • Gemini
  • Another AI (please specify): Cursor
  • Other (please specify):

License: MIT (@license in mod metadata).
Author metadata: @github matches PR author (tonythethompson).

…hover auto-expand and restores mouse wheel scrolling during drag-and-drop in File Explorer.
@tonythethompson tonythethompson changed the title Add explorer-nav-dragover-fix mod Add Explorer Nav DragOver Fix mod May 27, 2026
tonythethompson and others added 5 commits May 26, 2026 23:17
…se Wh_GetIntSetting for improved clarity and consistency.
Forward drag-time wheel to Explorer SysListView32 while preserving nav-pane behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wheel forwarding now targets Explorer nav pane and main file list pane.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Forward drag-time wheel to the right file pane (ItemsView/DirectUI on Win11 25H2 Details, classic SysListView32 in Large icons/List).

- Prefer UI Automation ScrollPattern before wheel messages; never target SHELLDLL_DefView for modern hosts.

- v1.1.8: try UIA on all content hosts including SysListView32.

- Per-drag caches, COM on drag thread, named timeouts, subclass race fix, readme troubleshooting.
@tonythethompson tonythethompson changed the title Add Explorer Nav DragOver Fix mod Add Explorer Nav DragOver Fix mod (nav hover-expand jump + wheel during drag) May 27, 2026
…1.1.9)

Scale UIA Scroll() calls using SPI_GETWHEELSCROLLLINES/CHARS so file-pane wheel during drag matches normal line scroll. Remove the old 2-call cap that muted travel. Bump version to 1.1.9.
Comment thread mods/explorer-nav-dragover-fix.wh.cpp Outdated
Comment thread mods/explorer-nav-dragover-fix.wh.cpp Outdated
Comment thread mods/explorer-nav-dragover-fix.wh.cpp Outdated
}

CabinetAtPointContext ctx{pt};
EnumWindows(CabinetAtPointEnumProc, reinterpret_cast<LPARAM>(&ctx));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This might return a window that belongs to another process. Also, why is the check above not enough?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The WindowFromPoint path is not enough during DoDragDrop: the cursor can sit over an Explorer frame while WindowFromPoint returns a drag-feedback layer whose root is not CabinetWClass. The fallback is a same-process geometry hit test for that case.

Added a GetCurrentProcessId() filter so we do not match another process's top-level window that happens to use the same class name.

Remove redundant nested EnumChildWindows walks, restrict cabinet hit-test fallback to the current process, correct Wh_ModInit lifecycle comments, and drop the init-time drag-generation bump that assumed DLL reuse on toggle.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tonythethompson tonythethompson requested a review from m417z May 31, 2026 22:13
@m417z m417z merged commit e10c123 into ramensoftware:main Jun 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants