tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
85.52k stars 2.58k forks source link

[bug] can't drag a `data-tauri-drag-region` element when the window is not focused #11605

Closed rhinoc closed 2 weeks ago

rhinoc commented 2 weeks ago

Describe the bug

System: macOS Sonoma

Expected

window can be dragged when It is not focused

What I've got

  1. trying to drag the window -> the window first get focus but not move
  2. trying to drag the window twice -> the window moves because it has already focused

https://github.com/user-attachments/assets/e59db5c9-3eda-448d-bb02-f7c75cadbd79

Reproduction

<header data-tauri-drag-region>
</header>

Expected behavior

No response

Full tauri info output

[⚠] Environment
    - OS: Mac OS 14.6.1 x86_64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15) (Homebrew)
    ✔ cargo: 1.82.0
    ⚠ rustup: not installed!
      If you have rust installed some other way, we recommend uninstalling it
      then use rustup instead. Visit https://rustup.rs/
    ⚠ Rust toolchain: couldn't be detected!
      Maybe you don't have rustup installed? if so, Visit https://rustup.rs/
    - node: 20.11.0
    - pnpm: 9.4.0
    - npm: 10.2.4
    - bun: 1.1.13

[-] Packages
    - tauri 🦀: 2.0.6
    - tauri-build 🦀: 2.0.2
    - wry 🦀: 0.46.3
    - tao 🦀: 0.30.3
    - @tauri-apps/api : 2.0.3
    - @tauri-apps/cli : 2.0.5

[-] Plugins
    - tauri-plugin-autostart 🦀: 2.0.1
    - @tauri-apps/plugin-autostart : 2.0.0
    - tauri-plugin-window-state 🦀: 2.0.1
    - @tauri-apps/plugin-window-state : 2.0.0
    - tauri-plugin-store 🦀: 2.1.0
    - @tauri-apps/plugin-store : 2.1.0
    - tauri-plugin-shell 🦀: 2.0.2
    - @tauri-apps/plugin-shell : 2.0.1
    - tauri-plugin-single-instance 🦀: 2.0.1
    - @tauri-apps/plugin-single-instance : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../build
    - devUrl: http://localhost:1420/
    - framework: Svelte
    - bundler: Rollup

Stack trace

No response

Additional context

No response

FabianLars commented 2 weeks ago

Can you try setting "acceptFirstMouse": true on the window config?

rhinoc commented 2 weeks ago

Can you try setting "acceptFirstMouse": true on the window config?

It works! I'll close this issue.