-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(window): add drag-stopped and resize-stopped events using move/r… #14503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Legend-Master
left a comment
There was a problem hiding this 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', () => { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.
|
@Legend-Master As suggested, I didn’t implement drag-stopped / resize-stopped inside the Instead, I added a userland example to the Tauri documentation that shows how Link to PR in tauri-docs: This keeps the runtime unchanged while still giving developers a clear and |
feat(window-events): add drag-stopped and resize-stopped events
tauri://moveto detect when window dragging stopsusing a 150ms idle timeout.
tauri://resizeto detect resize-stop events.This closes [feat] Drag-stopped and resize-stopped event are needed #14489