tauri-apps / tauri

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

[bug] In linux `appWindow.isFocused` is always `false`. #11323

Open ayangweb opened 5 days ago

ayangweb commented 5 days ago

Describe the bug

HeyπŸ‘‹, appWindow.isFocused is always false in linux, but it's fine in macOS and Windows! How can this problem be solved?

const appWindow = getCurrentWebviewWindow();

const focused = await appWindow.isFocused();

Reproduction

No response

Expected behavior

No response

Full tauri info output

[βœ”] Environment
    - OS: Ubuntu 22.4.0 aarch64 (X64)
    βœ” webkit2gtk-4.1: 2.44.3
    βœ” rsvg2: 2.52.5
    βœ” rustc: 1.81.0 (eeb90cda1 2024-09-04)
    βœ” cargo: 1.81.0 (2dbb1af80 2024-08-20)
    βœ” rustup: 1.27.1 (54dd3d00f 2024-04-24)
    βœ” Rust toolchain: stable-aarch64-unknown-linux-gnu (default)
    - node: 20.18.0
    - pnpm: 9.12.1
    - npm: 10.8.2

[-] Packages
    - tauri πŸ¦€: 2.0.2
    - tauri-build πŸ¦€: 2.0.1
    - wry πŸ¦€: 0.44.1
    - tao πŸ¦€: 0.30.3
    - @tauri-apps/api : 2.0.2
    - @tauri-apps/cli : 2.0.2

[-] Plugins
    - tauri-plugin-single-instance πŸ¦€: 2.0.1
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-os πŸ¦€: 2.0.1
    - @tauri-apps/plugin-os : 2.0.0
    - tauri-plugin-global-shortcut πŸ¦€: 2.0.1
    - @tauri-apps/plugin-global-shortcut : 2.0.0
    - tauri-plugin-log πŸ¦€: 2.0.1
    - @tauri-apps/plugin-log : 2.0.0
    - tauri-plugin-process πŸ¦€: 2.0.1
    - @tauri-apps/plugin-process : 2.0.0
    - tauri-plugin-fs πŸ¦€: 2.0.1
    - @tauri-apps/plugin-fs : 2.0.0
    - 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 : not installed!
    - tauri-plugin-dialog πŸ¦€: 2.0.1
    - @tauri-apps/plugin-dialog : 2.0.0
    - tauri-plugin-updater πŸ¦€: 2.0.2
    - @tauri-apps/plugin-updater : 2.0.0
    - tauri-plugin-shell πŸ¦€: 2.0.1
    - @tauri-apps/plugin-shell : 2.0.0
    - tauri-plugin-sql πŸ¦€: 2.0.1
    - @tauri-apps/plugin-sql : 2.0.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

No response

witt-bit commented 4 days ago

Hey guys🀣, the task on Linux is arduous, the revolution has not yet succeeded, comrades still need to work hardπŸ€¦β€β™‚οΈ!