Repository: tauri
Issue: [bug] setLevel_ and setCollectionBehavior_ not work in fullscreen of release but work in fullscreen of dev
Labels: type: bug,platform: macOS,status: needs triage

### Describe the bug

The following code works fine in the development environment, but will not take effect after packaging.

```rust
fn main() {
    tauri::Builder::default()
        .setup(|app| {
            let main_window = app.get_window("main").unwrap();

            #[cfg(target_os = "macos")]
            {
                use cocoa::appkit::{NSMainMenuWindowLevel, NSWindow, NSWindowCollectionBehavior};
                use cocoa::base::id;
                let ns_win = main_window.ns_window().unwrap() as id;
                unsafe {
                    ns_win.setLevel_(((NSMainMenuWindowLevel + 1) as u64).try_into().unwrap());
                    ns_win.setCollectionBehavior_(
                        NSWindowCollectionBehavior::NSWindowCollectionBehaviorCanJoinAllSpaces,
                    );
                }
            }

            Ok(())
        })
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
```

### Reproduction

1.  yarn create tauri-app
2. cd [workspace]
3. yarn
4. modify Cargo.toml
```
[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.24.1"
```
5. replace main fn
```rust
use tauri::Manager;

fn main() {
    tauri::Builder::default()
        .setup(|app| {
            let main_window = app.get_window("main").unwrap();

            #[cfg(target_os = "macos")]
            {
                use cocoa::appkit::{NSMainMenuWindowLevel, NSWindow, NSWindowCollectionBehavior};
                use cocoa::base::id;
                let ns_win = main_window.ns_window().unwrap() as id;
                unsafe {
                    ns_win.setLevel_(((NSMainMenuWindowLevel + 1) as u64).try_into().unwrap());
                    ns_win.setCollectionBehavior_(
                        NSWindowCollectionBehavior::NSWindowCollectionBehaviorCanJoinAllSpaces,
                    );
                }
            }

            Ok(())
        })
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
```
6. yarn tarui dev // everything is ok
7. yarn tarui build // setLevel_ and setCollectionBehavior_ not work in fullscreen

### Expected behavior

Apps can also be pinned to the top in full screen

### Platform and versions

Environment
  › OS: Mac OS 13.0.0 X64
  › Node.js: 16.15.1
  › npm: 8.11.0
  › pnpm: 7.8.0
  › yarn: 1.22.19
  › rustup: 1.25.1
  › rustc: 1.63.0
  › cargo: 1.63.0
  › Rust toolchain: stable-aarch64-apple-darwin 

Packages
  › @tauri-apps/cli [NPM]: 1.1.1
  › @tauri-apps/api [NPM]: 1.1.0
  › tauri [RUST]: 1.1.1,
  › tauri-build [RUST]: 1.1.1,
  › tao [RUST]: 0.14.0,
  › wry [RUST]: 0.21.1,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:1420/
  › framework: React

App directory structure
  ├─ dist
  ├─ node_modules
  ├─ public
  ├─ src-tauri
  ├─ .git
  ├─ .vscode
  ├─ .idea
  └─ src


### Stack trace

_No response_

### Additional context

_No response_