fix: 切换到后台后一分钟内,截图效率降低的问题。
This commit is contained in:
parent
2058220ead
commit
a33659c8c5
12
src-tauri/Cargo.lock
generated
12
src-tauri/Cargo.lock
generated
@ -779,6 +779,7 @@ dependencies = [
|
||||
"futures",
|
||||
"hex",
|
||||
"image",
|
||||
"macos-app-nap",
|
||||
"mdns",
|
||||
"once_cell",
|
||||
"paris",
|
||||
@ -1771,6 +1772,17 @@ dependencies = [
|
||||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "macos-app-nap"
|
||||
version = "0.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9701bd74bcff7fb5f9bff8ff4930a889a55f9cccc8a0dfc4c51ea08b786f0c6a"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cocoa-foundation",
|
||||
"objc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "malloc_buf"
|
||||
version = "0.0.6"
|
||||
|
@ -35,6 +35,7 @@ futures = "0.3.25"
|
||||
either = "1.8.0"
|
||||
image = "0.24.5"
|
||||
mdns = "3.0.0"
|
||||
macos-app-nap = "0.0.1"
|
||||
|
||||
[features]
|
||||
# by default Tauri runs in production mode
|
||||
|
@ -92,6 +92,7 @@ impl CoreManager {
|
||||
}
|
||||
|
||||
pub async fn play_follow(&self) -> anyhow::Result<()> {
|
||||
macos_app_nap::prevent();
|
||||
let mut futs = vec![];
|
||||
let configs = picker::config::Manager::global().reload_config().await;
|
||||
let configs = match configs {
|
||||
@ -220,7 +221,7 @@ impl CoreManager {
|
||||
if let AmbientLightMode::Follow = *lock {
|
||||
drop(lock);
|
||||
let screenshot = picker.take_screenshot()?;
|
||||
// info!("Take Screenshot Spend: {:?}", start.elapsed());
|
||||
info!("Take Screenshot Spend: {:?}", start.elapsed());
|
||||
match tx.send(screenshot).await {
|
||||
Ok(_) => {}
|
||||
Err(err) => {
|
||||
|
Loading…
Reference in New Issue
Block a user