tauri-apps / tauri

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

Unable to correctly obtain full screen attribute when monitoring window size changes #8416

Open frontierFlight opened 10 months ago

frontierFlight commented 10 months ago

Describe the bug

After listening to the onResized window in Vue's onMounted and obtaining the return value of appWindow. isFullscreen(), it was found that the value was incorrect. And sometimes the monitoring will be executed twice.

Reproduction

No response

Expected behavior

Obtain correct isFullscreen information

Platform and versions

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 120.0.2210.61
    ✔ MSVC: Visual Studio Professional 2022
    ✔ rustc: 1.71.0 (8ede3aae2 2023-07-12)
    ✔ cargo: 1.71.0 (cfd3bbd8f 2023-06-08)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.16.0
    - pnpm: 8.5.1
    - yarn: 1.22.17
    - npm: 9.5.1

[-] Packages
    - tauri [RUST]: 1.5.3
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.6
    - tao [RUST]: 0.16.5
    - @tauri-apps/api [NPM]: 1.5.1 (outdated, latest: 1.5.2)
    - @tauri-apps/cli [NPM]: 1.5.6 (outdated, latest: 1.5.8)

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace

test.vue

onMounted(async () => {
  const unlisten = await appWindow.onResized(async ({ payload: size }) => {
    console.log('payload: size', size)
    const isFull  = await appWindow.isFullscreen();
    console.log('isFull: ', isFull);
  });
})

Additional context

No response

amrbashir commented 10 months ago

I can't seem to reproduce the incorrect values of window.isFullscreen(), please provide a minimal repro that I can use to test.