Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Calling window.hide() followed by window.set_fullscreen(false) doesn't do anything #12056

Open
omerdn1 opened this issue Dec 26, 2024 · 0 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@omerdn1
Copy link

omerdn1 commented Dec 26, 2024

Describe the bug

If I call hide on a window after calling set_fullscreen(false), the window just exists full screen but it still visible. I need to call hide again, with a sleep for it to disappear.

EDIT: Also, calling hide without exiting fullscreen first will hide the web view window but you'll still be in the new window created by MacOS - not sure if this is expected behavior.

Reproduction

hide_overlay(window: Window) {
    if let Some(fs_overlay) = window.get_webview_window("main") {
        fs_overlay.set_fullscreen(false).unwrap();
        fs_overlay.hide().unwrap();
    } else {
        println!("Overlay window not found");
    }

Workaround

hide_overlay(window: Window) {
    if let Some(fs_overlay) = window.get_webview_window("main") {
        fs_overlay.set_fullscreen(false).unwrap();
        tokio::spawn(async move {
          tokio::time::sleep(Duration::from_millis(2000)).await;  
            if let Some(fs_overlay) = window.get_webview_window("main") {
                fs_overlay.hide().unwrap();
            }
        });
    } else {
        println!("Overlay window not found");
    }

Full tauri info output

❯ pnpm tauri info

> tauri "info"


[✔] Environment
    - OS: Mac OS 13.6.4 x86_64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 23.1.0
    - pnpm: 9.15.1
    - yarn: 1.22.22
    - npm: 10.9.0

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins

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

Stack trace

No response

Additional context

No response

@omerdn1 omerdn1 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Dec 26, 2024
@omerdn1 omerdn1 changed the title [bug] Calling window.hide() when in fullscreen doesn't hide the window [bug] Calling window.hide() followed by window.set_fullscreen(false) doesn't do anything Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant