Repository: tauri
Issue: [bug] inner_size giving incorrect dimensions on window creation
Labels: type: bug,status: needs triage

### Describe the bug

I'm trying to create a new window from rust and embed a GStreamer sink into it. However, to do so, I need the dimensions of the window to embed the surface. The window is opening in fullscreen (1920 x 1800). I'm trying to use the `inner_size` method and I'm not getting the correct dimensions i.e width: 852, height: 652 even though my monitor's dimensions are 1920 x 1080
```rs
static APP_HANDLE: OnceCell<Mutex<AppHandle>> = OnceCell::const_new();

#[tauri::command]
async fn initialize() -> Result<(), Error> {
    // some other stuff happening here
          let webview_window = WebviewWindowBuilder::new(
          app_handle.app_handle(),
          "overlay",
          WebviewUrl::External(Url::parse("https://example.com").unwrap()),
      )
      .decorations(false)
      .shadow(false)
      .fullscreen(true)
      .minimizable(false)
      .closable(false)
      .skip_taskbar(true)
      .transparent(true)
      .focused(false)
      .build()
      .expect("Failed to create overlay window");

       if let Some(overlay) = app_handle.get_webview_window("overlay") {
          // giving incorrect dimensions
          let size = overlay.inner_size();
          println!("SIZE {:?}", size);
      }
      let inner_size = webview_window.inner_size().unwrap();
      let inner_position = webview_window.inner_position().unwrap();
       // giving incorrect dimensions
      println!("{:?}, {:?}", inner_size, inner_position);


}

pub fn run() {
    let app = tauri::Builder::default()
        .plugin(tauri_plugin_http::init())
        .plugin(tauri_plugin_shell::init())
        .invoke_handler(tauri::generate_handler![greet, get_pin, socket_initialize,])
        .build(tauri::generate_context!())
        .expect("error while building");
    let app_handle = app.handle().clone();
    let cloned_app_handle = app.handle().clone();
    APP_HANDLE
        .set(Mutex::new(app_handle))
        .expect("Could not set static variable");
    tauri::async_runtime::spawn(async move {
        let mut interval = tokio::time::interval(Duration::from_secs(2));
        loop {
            interval.tick().await;
            if let Some(overlay) = cloned_app_handle.get_webview_window("overlay") {
                let size = overlay.inner_size();
                // giving correct dimensions 1920 x 1080
                println!("SIZE: {:?}", size);
            }
        }
    });
    app.run(|_, _| {});
}

```

### Reproduction

_No response_

### Expected behavior

Expecting `inner_size()` to give me correct dimensions of 1920 x 1080

### Full `tauri info` output

```text
✔] Environment
    - OS: Fedora 41.0.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.4
    ✔ rsvg2: 2.59.2
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 22.12.0
    - pnpm: 9.15.1
    - 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
    - tauri-plugin-http 🦀: 2.2.0
    - @tauri-apps/plugin-http : 2.0.0 (outdated, latest: 2.2.0)
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : 2.0.0 (outdated, latest: 2.2.0)
    - tauri-plugin-fs 🦀: 2.2.0
    - @tauri-apps/plugin-fs : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../build
    - devUrl: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite
```


### Stack trace

_No response_

### Additional context

I'm seeing that the dimensions that I'm getting correct after the first restart. But doing a run after that is giving me the incorrect dimensions