macOS uses a different coordinate system for visibleFrame, so to get accurate values we should only get the diff between frame() and visibleFrame() and apply that to the standard monitor position returned by CGDisplayBounds. Size isn't impacted by this, and properly returns the value (accounting for dock position).
* fix(core): fix TrayIcon.getById returning new resource IDs
this prevents the close() from working properly if you somehow lose the new() resource ID (for instance when the app reloads) and need to pick it up again and close it.
* cleanup on close
* Use `Headers` in `sendIpcMessage`
* Add change file
* Change files
* Don't use optional chaining
Seems like we have changed it in #9530 deliberately,
so preserving it in this change
* do not let the tauri headers to be overwritten
Co-authored-by: Sean Wang <126865849+WSH032@users.noreply.github.com>
* use HeadersInit on the type definition
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Sean Wang <126865849+WSH032@users.noreply.github.com>
* fix(webdriver): windows: make native webdriver close with parent process
* add change file
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* feat(cli): enhance iOS bundle version formatting
follow-up for #13030 and https://github.com/tauri-apps/cargo-mobile2/pull/450
the bundle version validation has been updated, now it can actually handle one or two integers (e.g. `100` or `10.7`) instead of just full triple semver strings (e.g. `10.7.1`).
* lint
* Add an option for preventing window overflow
* Fix shadow counted as part of the width
* Enable prevent overflow by default
* Fix crashing when margin is bigger than screen
* Config file support
* Add to ts type
* Add mac implementation
* Should be let some
* Apply suggestions from code review
Co-authored-by: Jason Tsai <jason@pews.dev>
* checked_sub -> saturating_sub
* Revert license header
* Migrate windows 0.58
* Generate schema
* Fix merge conflict
* Try casting to objc2_app_kit::NSScreen
* Add NSScreen feature
* Use cast instead of as
* fmt
* Deref first
* Wrong unsafe block
* Add change file
* Add serde alias
* More docs
* Disable prevent_overflow by default
since we can't make breaking changes anymore right now
* Remove unused default impl
* Missing pub
* Fix mock_runtime on ios
* Match PreventOverflowMargin's description
* Typo
* Apply suggestions from code review
* Move get_work_area_size to seperate files
* Unused imports
* Add prevent_overflow to WebviewWindowBuilder
* Fix mac compile
* MonitorExt is only for desktop
* Rename to work_area
* Use workarea for linux
* Missing `()`
* Convert size
* Import MonitorExt
* as u32
* Re-build API js
* Fix wrong docs for work_area
* Remove linux platform specific note
* Remove left over linux platform specific note
* Use work area API for center as well
* Fix mobile
* Clean up
* small cleanup
* fix codegen
* update docs
* fix generated
---------
Co-authored-by: Jason Tsai <jason@pews.dev>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* fix(cli): iOS dev broken on Xcode 16.3, closes#13128
Looks like we cannot use the arm64-sim custom architecture on Xcode 16.3, as it incorrectly appends the -sim suffix on some clang build scripts which ends up with an invalid target triple.
Currently we do not have automation to update Xcode/Android projects, so a manual intervention is required by our users, either recreating the project or modifying it manually (the arm64-sim arch must be removed and all its references).
ref https://github.com/tauri-apps/cargo-mobile2/pull/445
* fix dev on macOS with intel chip
* Fix channel cb never cleaned up from `window`
* Should be `_{id}`
* Still need to manually impl clone
* Regenerate bundle.global.js
* Remove current_index from ChannelInner
* Move phantom to `Channel`
* `Channel` not `Self`
* Clean up
* Clean up
* Fix missing end quote
* Add change file
* Rename id to index to match js side
* Improve channel speed on small data
* do the same perf check for IPC responses and raw bytes
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* macOS/iOS: add option to disable or enable link previews when building a webview (the webkit api has it enabled by default)
- `WebViewBuilderExtDarwin.allow_link_preview(allow_link_preview: bool)`
- `WebViewBuilder.allow_link_preview(allow_link_preview: bool)`
- `WebviewWindowBuilder.allow_link_preview(allow_link_preview: bool)`
* also call on iOS
* add api
* fix tests
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* chore: fix a few internal docs
* Remove label clone
* Unused allow lint
* No way clippy just updated
* `cargo clippy --fix -- -W clippy::redundant_clone`
* format
* api!: expose api to run initialisation scripts on all frames.
* remove breaking change, add new api instead.
* Update .changes/init-script-on-all-frames.md
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* use struct `InitializationScript` instead of tuple
* Update crates/tauri-runtime/src/webview.rs
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* Apply suggestions from code review
* Update crates/tauri/src/webview/webview_window.rs
---------
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>