Skip to content
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

feat(macos): add Reopen event, closes #218 #517

Merged
merged 3 commits into from
May 2, 2024

Conversation

BillGoldenWater
Copy link
Contributor

@BillGoldenWater BillGoldenWater commented Aug 4, 2022

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

in macOS the app usually doesn't exit when all window closed, and will use click on dock icon for reopen window.
https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428638-applicationshouldhandlereopen?language=objc


this is a recreate of pr #515, due to it's not signed because misconfiguration in git

@BillGoldenWater BillGoldenWater requested a review from a team as a code owner August 4, 2022 09:28
@BillGoldenWater BillGoldenWater changed the title feat(macos): add ApplicationShouldHandleReopen event feat(macos): add ApplicationShouldHandleReopen event, close #218 Aug 28, 2022
@BillGoldenWater BillGoldenWater changed the title feat(macos): add ApplicationShouldHandleReopen event, close #218 feat(macos): add ApplicationShouldHandleReopen event, closes #218 Aug 28, 2022
@alchaplinsky
Copy link

Are there any plans on merging this?

@wusyong
Copy link
Member

wusyong commented Dec 4, 2022

We plan to switch to winit as #470 described. So winit also needs to implement this one.
@amrbashir Do you think we should merge this?

@amrbashir
Copy link
Member

last time I checked, the winit team has not decided on how they want to introduce this so I think we should keep this open until we make the switch.

@alchaplinsky
Copy link

@wusyong By switching you mean that winit will be used in tauri as a window management library instead of tao?

@wusyong
Copy link
Member

wusyong commented Dec 4, 2022

@wusyong By switching you mean that winit will be used in tauri as a window management library instead of tao?

We plan to do so in v2.0. If it's not that urgent, I suppose open a PR on winit is a good start.

@alchaplinsky
Copy link

@wusyong Ok got it. Makes sense. But is there a way currently in tauri to handle this issue tauri-apps/tauri#3084 (opening a window on dock icon click)?

@wusyong
Copy link
Member

wusyong commented Dec 5, 2022

I don't think so until this PR is merged in winit.

@lencx
Copy link

lencx commented Dec 9, 2022

Use minimized windows instead of hide.

tauri::Builder::default()
    .on_window_event(|event| {
        if let tauri::WindowEvent::CloseRequested { api, .. } = event.event() {
            // event.window().hide().unwrap();
            event.window().minimize().unwrap();
            api.prevent_close();
        }
    })

@tance77
Copy link

tance77 commented Feb 10, 2023

Would love to see this in the next version of Tauri. Missing this functionality. Great work.

@BillGoldenWater BillGoldenWater changed the title feat(macos): add ApplicationShouldHandleReopen event, closes #218 feat(macos): add Reopen event, closes #218 May 1, 2024
@thewh1teagle thewh1teagle mentioned this pull request May 1, 2024
2 tasks
@amrbashir amrbashir merged commit f06843b into tauri-apps:dev May 2, 2024
9 checks passed
@github-actions github-actions bot mentioned this pull request May 2, 2024
@amrbashir
Copy link
Member

amrbashir commented May 2, 2024

Thanks @BillGoldenWater for your work and sorry for the very long delay, do you plan to work on adding this event to tauri?

@BillGoldenWater
Copy link
Contributor Author

do you plan to work on adding this event to tauri?

yes

@amrbashir
Copy link
Member

Thank you 🙏

@pronebird
Copy link

Really looking forward that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants