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

fix: #268 - Add API for MacOS NSWindow::isDocumentEdited() #287

Merged
merged 6 commits into from
Oct 3, 2022

Conversation

joshchngs
Copy link
Contributor

What kind of change does this PR introduce?

This fixes #268 and therefore tauri-apps/tauri#3125

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 #___, #___)
  • 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

The setter API is added upstream in the cocoa crate (servo/core-foundation-rs PR #493)), which will need to be merged & released before this PR.

@joshchngs joshchngs requested a review from a team January 17, 2022 19:52
src/window.rs Outdated Show resolved Hide resolved
@amrbashir
Copy link
Member

Thanks for contribution. It seems the PR you linked, just got merged, I guess we need to wait for release only.

@joshchngs
Copy link
Contributor Author

joshchngs commented Jan 17, 2022

Done. I'm not clear on the difference between Window & UnownedWindow (in terms of usage), but everything builds & tests the same.

src/platform_impl/macos/window.rs Outdated Show resolved Hide resolved
This fixes tauri-apps#268 and therefore tauri-apps/tauri#3125

The setter API is added upstream in the cocoa crate
(servo/core-foundation-rs PR tauri-apps#493)
@amrbashir amrbashir added status: waiting Waiting for a response or another PR status: upstream labels Jan 20, 2022
@amrbashir
Copy link
Member

This PR needs to wait for a new release of cocoa crate

unsafe {
self
.ns_window
.isDocumentEdited()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a new version of cocoa won't be released anytime soon and we have been waiting for ages, can you just inline the objc call from this PR https://github.com/servo/core-foundation-rs/pull/493/files here

src/platform/macos.rs Outdated Show resolved Hide resolved
amrbashir
amrbashir previously approved these changes Oct 3, 2022
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@amrbashir amrbashir requested a review from a team as a code owner October 3, 2022 22:06
@amrbashir amrbashir merged commit 25b0f30 into tauri-apps:next Oct 3, 2022
amrbashir pushed a commit that referenced this pull request Oct 3, 2022
* Add API for MacOS NSWindow::isDocumentEdited()

This fixes #268 and therefore tauri-apps/tauri#3125

The setter API is added upstream in the cocoa crate
(servo/core-foundation-rs PR #493)

* use objc directly

* fmt

* cast to i8

* Update src/platform/macos.rs
@github-actions github-actions bot mentioned this pull request Oct 3, 2022
@amrbashir
Copy link
Member

lol the PR is so old, it was targeting next and I didn't notice so I had to cherry pick it into dev and reset next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: upstream status: waiting Waiting for a response or another PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Support macOS isDocumentEdited
2 participants