-
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor new method entry point to rwh (#1041)
* Refactor new method entry point to rwh * Update doc and add change file * Fix mac and ios compile error * Add new_as_child * Add rhw_04, 05 06 flags * Update android port * Remove winit CI * Fix android bindings * windows implementation * Update Cargo.toml * Fix macOS and iOS * Fix Android * fix is_child on WkWebView * x11 impl * expose `new_gtk` * fix winit-gtk version * remove undecorated resizing handling * implement set_position and set_size for child gtk in x11 * fix macos * more fixes * one more time * unreachable * update actions * fix windows * some clippy * Add documentation and fix clippy * Fix windows clippy error * Fix android biuld * Fix documentation test * Fix android again * Reduce clippy noise * use rc? * refine some documentation, add set_visible * fix set_visible * impl set_visible on Windows * fix doctests * more set_visible fixes * fix windows * unsafe * fix set size for child webviews * fix initial visibility with new_gtk * refine examples * fix wpgu example * fix examples on windows and macos * use a better workaround * make set_size work on x11 * Fix size in multiwebview example * Add visible method on macOS and iOS * remvoe `tao` from android backend and update documentation * fix winit example * Add new_as_content_view on macOS * allow using raw-window-handle v0.5 [skip ci] * change trait name [skip ci] * fix linux impl [skip ci] * fix android build [skip ci] * fix windows build * fix(macos): do not autoresize on child webview [skip ci] * fix macos coordinates [skip ci] * fix example [skip ci] * fixed child on macos [skip ci] * fix docs typos [skip ci] * fix webview position when it's not a child [skip ci] * replace new_as_content_view with new_as_subview * with_as_subview instead of constructor [skip ci] * fix position/size when as_subview is true * lint & fmt * Fix ios build * Fix cargo test * Fix mac build * Update macOS contrusctors * cargo fmt * impl drop on Windows * fix child transparency on Windows (still needs PRs in tao and winit) * fix winit usage in the examples, use rwh_05 only for now * fix tests * add webview.focus * fix dropping on Linux * chore clean examples * implement focus on Linux * macos focus --------- Co-authored-by: amrbashir <[email protected]> Co-authored-by: Lucas Nogueira <[email protected]> Co-authored-by: Lucas Nogueira <[email protected]>
- Loading branch information
1 parent
81cfa37
commit 783b142
Showing
71 changed files
with
3,426 additions
and
3,449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
"wry": minor | ||
--- | ||
|
||
Refactor new method to take raw window handle instead. Following are APIs got affected: | ||
- `application` module is removed, and `webivew` module is moved to root module. | ||
- `WebviewBuilder::new`, `Webview::new` now take `RawWindowHandle` instead. | ||
- Attributes `ipc_handler`, `file_drop_handler`, `document_change_handler` don't have window parameter anymore. | ||
Users should use closure to capture the types they want to use. | ||
- Position field in `FileDrop` event is now `Position` instead of `PhysicalPosition`. Users need to handle scale factor | ||
depend on the situation they have. | ||
- `Webview::inner_size` is removed. | ||
|
||
This also means that we removed `tao` as a dependency completely which required some changes to the Android backend: | ||
- We exposed the `android_setup` function that needs to be called once to setup necessary logic. | ||
- Previously the `android_binding!` had internal call to `tao::android_binding` but now that `tao` has been removed,sa | ||
the macro signature has changed and you now need to call `tao::android_binding` yourself, checkout the crate documentation for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
name: Audit | ||
# Copyright 2022-2022 Tauri Programme within The Commons Conservancy | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: audit | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- 'Cargo.lock' | ||
- 'Cargo.toml' | ||
pull_request: | ||
paths: | ||
- "Cargo.lock" | ||
- "Cargo.toml" | ||
- 'Cargo.lock' | ||
- 'Cargo.toml' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
audit-rust: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: rust audit | ||
uses: actions-rs/audit-check@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: rustsec/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2022-2022 Tauri Programme within The Commons Conservancy | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: clippy & fmt | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
clippy: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: install system deps | ||
if: matrix.platform == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libwebkit2gtk-4.1-dev | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
|
||
- run: cargo clippy --all-targets | ||
|
||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
|
||
- run: cargo fmt --all -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.