Skip to content

Let native titlebar dragging handle double-click maximize - #91

Merged
vanloctech merged 1 commit into
vanloctech:mainfrom
huuhungn:pr/titlebar-double-click
Jul 3, 2026
Merged

vanloctech merged 1 commit into
vanloctech:mainfrom
huuhungn:pr/titlebar-double-click

Conversation

@anhtahaylove

Copy link
Copy Markdown
Contributor

Summary

  • Remove the manual startDragging() call from the titlebar drag region.
  • Keep native Tauri drag handling via data-tauri-drag-region and leave double-click to toggleMaximize().

Why

On Windows, the native drag region and manual startDragging() can fight the double-click maximize path: the window maximizes and then immediately restores back to windowed mode.

Verification

  • bun run biome check --write .
  • bun run tsc -b
  • cargo check

Notes

This keeps the existing custom titlebar and window controls unchanged.

The titlebar drag area already declares Tauri's native drag region. Calling startDragging on mouse down from that same region races the double-click maximize path on Windows, causing the window to restore immediately after maximizing.

Constraint: Preserve the existing custom titlebar and window controls.
Rejected: Add debounce logic around double-click maximize | Removing the duplicate drag path is smaller and avoids timing-dependent behavior.
Confidence: high
Scope-risk: narrow
Directive: Keep manual startDragging off elements marked data-tauri-drag-region unless native dragging is intentionally removed.
Tested: bun run biome check --write .
Tested: bun run tsc -b
Tested: cargo check
Not-tested: Manual Windows double-click titlebar check on this upstream PR branch.
@vanloctech
vanloctech merged commit cd1495c into vanloctech:main Jul 3, 2026
3 checks passed
@anhtahaylove
anhtahaylove deleted the pr/titlebar-double-click branch July 4, 2026 16:50
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