-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
refactor(macos): migrate to objc2
#1316
Conversation
* refactor: migrate to `dpi` crate closes #1172 * macOS * linux * fix doctests * imports * more doctests * fix android and ios * Update examples/winit.rs Co-authored-by: Jason Tsai <[email protected]> * Update src/webview2/mod.rs --------- Co-authored-by: Jason Tsai <[email protected]>
* fix(wkwebview): menu shortcuts * Update wkwebview.md
Co-authored-by: amrbashir <[email protected]>
Package Changes Through faef2ebThere are 1 changes which include wry with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
17287ab
to
fdd1534
Compare
fdd1534
to
4eec6fb
Compare
d2ff37d
to
b3f0a6a
Compare
4336d96
to
7674bf3
Compare
320b26d
to
56a5616
Compare
Note: iOS can now be built and run on the iOS simulator from Tauri (it requires some modification in Tauri to use objc2). It's still WIP for testing some functionalities and organizing the code. |
I think the review will take a long time, and this PR is about 90% complete, so it might be worth starting the review and having some feedback earlier. |
let app: id = msg_send![app_class, sharedApplication]; | ||
let _: () = msg_send![app, activateIgnoringOtherApps: YES]; | ||
let app = NSApplication::sharedApplication(mtm); | ||
NSApplication::activate(&app); |
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.
this change seems to be panicing, see tauri-apps/tauri#11340
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.
https://developer.apple.com/documentation/appkit/nsapplication/4168336-activate
It seems Activate
was added after 14.0, and activateignoringotherapps
is deprecated after 14.0
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.
nice finding @pewsheen, so I guess we need to gate that behind a version check
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.
* fix: use `activateIgnoringOtherApps` on older macOS versions closes tauri-apps/tauri#11340 ref: #1316 (comment) * clippy --------- Co-authored-by: Lucas Nogueira <[email protected]>
Issue: #1239
Roadmap
objc
dependencydev
branch{}URLSchemeHandler(We need to create it dynamically)Functionality Test:
[mac]
Reparent[ios]
setAllowsInlineMediaPlayback (not merged yet, indev
)[mac]
Synthetic mouse event[mac]
Tab focuses links[mac]
with_back_forward_navigation_gesturesdev
as well)[mac]
with_drag_drop_handler[mac]
with_accept_first_mouse[mac]
print[mac]
open_devtools[mac]
close_devtools[mac]
is_devtools_open[mac]
set_bounds (child webview)Issues
objc2-web-kit
not supportWKWebView
on iOS. We need this so we can continue the migration.objc2_web_kit::WKWebView
supportsiOS
madsmtm/objc2#637NSException
so we can recover from some situations? I'm usingcatch_unwind
now for the exception, but I think this is not ideal.tauri-runtime-wry
need to useobjc2
as well