feat: hide main window on Cmd+W and restore on reopen#241
feat: hide main window on Cmd+W and restore on reopen#241Dimillian merged 5 commits intoDimillian:mainfrom
Conversation
|
Note: This follows the typical macOS pattern where Cmd+W hides/closes the window but keeps the app running, so reopening via the dock/menu restores the UI without losing session state. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dad99b1008
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8fe26af85
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| app.run(|app_handle, event| { | ||
| if let RunEvent::Reopen { .. } = event { | ||
| if let Some(window) = app_handle.get_webview_window("main") { | ||
| let _ = window.show(); | ||
| let _ = window.set_focus(); |
There was a problem hiding this comment.
Guard mac-only RunEvent::Reopen usage
On Linux/Windows builds, RunEvent::Reopen is not available because Tauri gates that enum variant behind #[cfg(target_os = "macos")]. As written, this if let RunEvent::Reopen { .. } = event match will fail to compile on non-mac targets, breaking cross-platform builds. Consider wrapping the reopen handler in a #[cfg(target_os = "macos")] block or using a cfg-guarded helper.
Useful? React with 👍 / 👎.
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
Summary
Testing
Fixes #240