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] new webview added to the window does not appear on top (Windows) #9798

Closed
seb-hernandez opened this issue May 16, 2024 · 0 comments · Fixed by tauri-apps/wry#1271
Closed
Labels
scope: unstable flag Issue only occures with "unstable" feature flag enabled status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@seb-hernandez
Copy link

Describe the bug

I am creating a window and adding my main webview to it. After that, I am adding a second webview. On macOS, this new webview overlaps the main webview (appears on top). However, on Windows, it gets positioned behind the main webview. To make the second webview visible on Windows, I need to manually set the size of the main webview to zero width and height (making it "disappear").

I would like to know which behavior should be considered the default: the one on macOS or on Windows. Personally, I prefer the way it works on macOS.

let window = WindowBuilder::new(app, "main")
    .inner_size(x, y)
    .title("title")
    .build()
    .unwrap();

let main_webview_builder =
    WebviewBuilder::new("main", WebviewUrl::App("index.html"))
        .auto_resize();

window
    .add_child(
        main_webview_builder,
        PhysicalPosition::new(0, 0),
        PhysicalSize::new(x, y),
    )
    .unwrap();

let new_webview_builder =
    WebviewBuilder::new("new", WebviewUrl::External("https://google.com"))
        .auto_resize();

window
    .add_child(
        new_webview_builder,
        PhysicalPosition::new(0, 0),
        PhysicalSize::new(x, y),
    )
    .unwrap();

Reproduction

No response

Expected behavior

No response

Full tauri info output

Windows:
[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 124.0.2478.97
    ✔ MSVC: 
        - Visual Studio Build Tools 2017
        - Visual Studio Build Tools 2022
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.20.2
    - pnpm: 9.0.5
    - yarn: 1.22.19
    - npm: 10.5.2

[-] Packages
    - tauri [RUST]: 2.0.0-beta.17
    - tauri-build [RUST]: 2.0.0-beta.13
    - wry [RUST]: 0.39.3
    - tao [RUST]: 0.27.1
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.1

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

Macos:
[✔] Environment
    - OS: Mac OS 14.3.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.20.2
    - pnpm: 9.0.2
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.17
    - tauri-build [RUST]: 2.0.0-beta.13
    - wry [RUST]: 0.39.3
    - tao [RUST]: 0.27.1
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.1

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

Stack trace

No response

Additional context

No response

@seb-hernandez seb-hernandez added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 16, 2024
@FabianLars FabianLars added the scope: unstable flag Issue only occures with "unstable" feature flag enabled label May 16, 2024
amrbashir added a commit to tauri-apps/wry that referenced this issue May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: unstable flag Issue only occures with "unstable" feature flag enabled status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants