Skip to content

Commit 4892637

Browse files
CGQAQamrbashirlucasfernog
authored
fix: Resizing glitch on custom titlebar click (closes #2549) (#5966)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com> Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio> closes #2549
1 parent ce76d95 commit 4892637

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changes/fix-2549.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": "patch"
3+
---
4+
5+
Fix resize glitch when double clicking a custom titlebar in the top resize area.

core/tauri/scripts/core.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@
136136
if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) {
137137
// prevents text cursor
138138
e.preventDefault()
139+
// fix #2549: double click on drag region edge causes content to maximize without window sizing change
140+
// https://github.com/tauri-apps/tauri/issues/2549#issuecomment-1250036908
141+
e.stopImmediatePropagation()
142+
139143
// start dragging if the element has a `tauri-drag-region` data attribute and maximize on double-clicking it
140144
window.__TAURI_INVOKE__('tauri', {
141145
__tauriModule: 'Window',

0 commit comments

Comments
 (0)