浏览代码

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 https://github.com/tauri-apps/tauri/issues/2549
Jason 2 年之前
父节点
当前提交
4892637f83
共有 2 个文件被更改,包括 9 次插入0 次删除
  1. 5 0
      .changes/fix-2549.md
  2. 4 0
      core/tauri/scripts/core.js

+ 5 - 0
.changes/fix-2549.md

@@ -0,0 +1,5 @@
+---
+"tauri": "patch"
+---
+
+Fix resize glitch when double clicking a custom titlebar in the top resize area.

+ 4 - 0
core/tauri/scripts/core.js

@@ -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',