refactor: use calloop channel

This commit is contained in:
Ashley Wulber 2022-06-23 12:15:08 -04:00
parent 8e9d7a1e91
commit 83edc4f695
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
5 changed files with 60 additions and 63 deletions

View file

@ -43,13 +43,9 @@ impl WorkspaceButton {
new_button.connect_clicked(move |_| {
let id_clone = id.clone();
if !is_active {
glib::MainContext::default().spawn_local(async move {
TX.get()
.unwrap()
.send(WorkspaceEvent::Activate(id_clone))
.await
.unwrap();
});
let _ = TX.get()
.unwrap()
.send(WorkspaceEvent::Activate(id_clone));
}
});