Skip to content

Commit

Permalink
fix: Resizing glitch on custom titlebar click (closes #2549) (#5966)
Browse files Browse the repository at this point in the history
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
closes #2549
  • Loading branch information
CGQAQ authored Jan 3, 2023
1 parent ce76d95 commit 4892637
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-2549.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": "patch"
---

Fix resize glitch when double clicking a custom titlebar in the top resize area.
4 changes: 4 additions & 0 deletions core/tauri/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@
if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) {
// prevents text cursor
e.preventDefault()
// fix #2549: double click on drag region edge causes content to maximize without window sizing change
// https://github.com/tauri-apps/tauri/issues/2549#issuecomment-1250036908
e.stopImmediatePropagation()

// start dragging if the element has a `tauri-drag-region` data attribute and maximize on double-clicking it
window.__TAURI_INVOKE__('tauri', {
__tauriModule: 'Window',
Expand Down

0 comments on commit 4892637

Please sign in to comment.