Skip to content

Commit ea9a3d5

Browse files
committed
feat: update example, focus and show
1 parent 60342cf commit ea9a3d5

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ There are three general methods of installation that we can recommend.
99
2. Git submodule install this repo in your tauri project and then use `file` protocol to ingest the source
1010
3. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
1111

12-
For more details and usage see [the vanilla demo](examples/vanilla/src-tauri/src/main.rs). Please note, below in the dependencies you can also lock to a revision/tag in the `Cargo.toml`.
12+
For more details and usage see [the vanilla demo](examples/vanilla/src-tauri/src/main.rs).
13+
Please note, below in the dependencies you can also lock to a revision/tag in the `Cargo.toml`.
1314

1415
`src-tauri/Cargo.toml`
1516
```yaml
@@ -29,5 +30,8 @@ fn main() {
2930
}
3031
```
3132

33+
To prevent flashes when the window is updated, the window `visible` property must be set to `false`.
34+
The plugin is responsible for showing it after restoring its state.
35+
3236
# License
3337
MIT / Apache-2.0

examples/vanilla/src-tauri/Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/vanilla/src-tauri/tauri.conf.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
"title": "app",
5757
"width": 800,
5858
"height": 600,
59-
"resizable": true,
60-
"fullscreen": false
59+
"visible": false
6160
}
6261
],
6362
"security": {

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ impl<R: Runtime> Plugin<R> for WindowState {
6060
}))
6161
.unwrap();
6262
}
63+
window.show().unwrap();
64+
window.set_focus().unwrap();
6365
}
6466

6567
fn on_event(&mut self, app: &AppHandle<R>, event: &Event) {

0 commit comments

Comments
 (0)