Repository: tauri
Issue: [bug] `ExitRequested` not fired on macOS
Labels: type: bug,platform: macOS,status: needs triage

### Describe the bug

```rust
// Prevents additipub(crate)onal console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

#[cfg(target_os = "macos")]
#[macro_use]
extern crate objc;

use tauri::{Manager, RunEvent, WindowEvent};
use tokio::runtime::Runtime;

use crate::download_helper::{get_download_client, pause_all_downloads, start_download};
use crate::hardware::{get_cpu_architecture, get_disk_usage, get_friendly_os_name, get_os_type};
use crate::window_ext::WindowExt;

mod window_ext;
mod hardware;
mod download_helper;
mod utils;

// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
async fn show_main_window(window: tauri::Window) {
    window.show().expect("Failed to show main window");
}

#[tokio::main]
async fn main() {
    tauri::async_runtime::set(tokio::runtime::Handle::current());

    let app = tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![
            show_main_window,
            get_cpu_architecture,
            get_os_type,
            get_friendly_os_name,
            get_disk_usage,
            pause_all_downloads,
            start_download
        ])
        .on_window_event(|e| {
            let apply_offset = || {
                let win = e.window();
                win.position_traffic_lights(20., 20.);
            };

            match e.event() {
                WindowEvent::Resized(..) => apply_offset(),
                WindowEvent::ThemeChanged(..) => apply_offset(),
                _ => {}
            }
        })
        .build(tauri::generate_context!())
        .expect("error while running tauri application");

    app.run(|app, event| match event {
        RunEvent::ExitRequested {api, ..} => {
            api.prevent_exit();

            println!("HELLO");

            tauri::async_runtime::block_on(async {
                pause_all_downloads().await;
            });
        },
        RunEvent::Ready { .. } => {
            let win = app.get_window("main").unwrap();
            win.set_transparent_titlebar(true);
            win.position_traffic_lights(20., 20.);
        },
        _ => {}
    });
}
```

nothing gets run when exit is requested

### Reproduction

_No response_

### Expected behavior

_No response_

### Full `tauri info` output

```text
[✔] Environment
    - OS: Mac OS 14.2.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.78.0-nightly (0ecbd0605 2024-02-25)
    ✔ cargo: 1.78.0-nightly (194a60b29 2024-02-21)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: nightly-aarch64-apple-darwin (default)
    - node: 21.1.0
    - pnpm: 8.15.4
    - yarn: 4.0.2
    - npm: 9.1.2
    - bun: 1.0.30

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - tauri-cli [RUST]: 1.5.10
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: SolidJS
    - bundler: Vite
```
```


### Stack trace

_No response_

### Additional context

_No response_