-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core)!: App::run_iteration improvements (#8696)
* refactor(core): App::run_iteration improvements * lint * fixes * fix exit * Apply suggestions from code review Co-authored-by: Fabian-Lars <[email protected]> * update cargo.toml * booooool * fix mock runtime * fix doctests * fix doctest againrrrr --------- Co-authored-by: Fabian-Lars <[email protected]>
- Loading branch information
1 parent
9cb9aa7
commit ec9818a
Showing
13 changed files
with
158 additions
and
75 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,5 @@ | ||
--- | ||
"tauri": patch:breaking | ||
--- | ||
|
||
Added a callback to the `App::run_iteration` and removed its return value. |
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 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 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 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 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,3 @@ | ||
# Run Iteration Example | ||
|
||
To execute run the following on the root directory of the repository: `cargo run --example run-iteration`. |
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,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Welcome to Tauri!</title> | ||
</head> | ||
<body> | ||
<h1>Welcome to Tauri!</h1> | ||
</body> | ||
</html> |
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,26 @@ | ||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-License-Identifier: MIT | ||
|
||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] | ||
|
||
use tauri::Manager; | ||
|
||
fn main() { | ||
let mut app = tauri::Builder::default() | ||
.build(tauri::generate_context!( | ||
"../../examples/run-iteration/tauri.conf.json" | ||
)) | ||
.expect("error while building tauri application"); | ||
|
||
loop { | ||
app.run_iteration(|_app, _event| { | ||
//println!("{:?}", _event); | ||
}); | ||
|
||
if app.webview_windows().is_empty() { | ||
app.cleanup_before_exit(); | ||
break; | ||
} | ||
} | ||
} |
Oops, something went wrong.