-
-
Notifications
You must be signed in to change notification settings - Fork 157
feat: hide main window on Cmd+W and restore on reopen #241
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 👍 / 👎.
Summary
Testing
Fixes #240