feat: 支持调整程序内存中暂存的显示器配置。

This commit is contained in:
2023-05-07 14:32:31 +08:00
parent 3a430716d6
commit 239144a446
7 changed files with 155 additions and 28 deletions

View File

@ -450,6 +450,20 @@ async fn main() {
}
});
let app_handle = app.handle().clone();
tokio::spawn(async move {
let display_manager = DisplayManager::global().await;
let mut rx =display_manager.subscribe_displays_changed();
while rx.changed().await.is_ok() {
let displays = rx.borrow().clone();
log::info!("displays changed. emit displays_changed event.");
app_handle.emit_all("displays_changed", displays).unwrap();
}
});
Ok(())
})
.run(tauri::generate_context!())