Use Task chaining to simplify multi_window example

This commit is contained in:
Héctor Ramón Jiménez 2024-06-14 03:04:51 +02:00
parent b21e4567dc
commit 88b9384402
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 107 additions and 96 deletions

View file

@ -1030,7 +1030,7 @@ fn run_action<A, C>(
}
},
Action::Window(action) => match action {
window::Action::Open(id, settings) => {
window::Action::Open(id, settings, channel) => {
let monitor = window_manager.last_monitor();
control_sender
@ -1041,6 +1041,8 @@ fn run_action<A, C>(
monitor,
})
.expect("Send control action");
let _ = channel.send(id);
}
window::Action::Close(id) => {
let _ = window_manager.remove(id);