Skip to content

Conversation

@Khyati-Kapil
Copy link

feat(window-events): add drag-stopped and resize-stopped events

@Khyati-Kapil Khyati-Kapil requested a review from a team as a code owner November 19, 2025 18:28
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Nov 19, 2025
Copy link
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

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

Seeing the limitation on this implementation, I think this should be done on user land or we'll need a more complete solution

})
}

window.addEventListener('tauri://resize', () => {
Copy link
Contributor

@Legend-Master Legend-Master Nov 27, 2025

Choose a reason for hiding this comment

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

This is not reliable to be honest

const cmd = e.detail === 2 ? 'internal_toggle_maximize' : 'start_dragging'
window.__TAURI_INTERNALS__.invoke('plugin:window|' + cmd)
// maximize on double-clicking it, or start dragging on single click
if (e.detail === 2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So I believe this only works for the dragging from our custom draggable region (data-tauri-drag-region)?

Copy link
Author

@Khyati-Kapil Khyati-Kapil Nov 28, 2025

Choose a reason for hiding this comment

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

Thanks for the feedback, I will try to provide the complete solution using another approach.

@Khyati-Kapil
Copy link
Author

@Legend-Master As suggested, I didn’t implement drag-stopped / resize-stopped inside the
runtime because the JS-side detection isn’t reliable enough for all
platforms.

Instead, I added a userland example to the Tauri documentation that shows how
developers can detect when window dragging or resizing has stopped by
listening to tauri://move and tauri://resize events and debouncing them.

Link to PR in tauri-docs:
tauri-apps/tauri-docs#3631

This keeps the runtime unchanged while still giving developers a clear and
recommended pattern to use until native backend support is added.
Happy to adjust or expand the docs if needed.

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

Labels

None yet

Projects

Status: 📬Proposal

Development

Successfully merging this pull request may close these issues.

[feat] Drag-stopped and resize-stopped event are needed

2 participants