fix zbus executor ticking
This commit is contained in:
parent
286c0e552d
commit
519424d42f
1 changed files with 11 additions and 5 deletions
|
@ -25,7 +25,6 @@ mod imp {
|
|||
window.present();
|
||||
|
||||
glib::spawn_future_local(async move {
|
||||
// run this in glib's main loop
|
||||
let conn = zbus::connection::Builder::session()
|
||||
.expect("could not connect to the session bus")
|
||||
.internal_executor(false)
|
||||
|
@ -33,6 +32,17 @@ mod imp {
|
|||
.await
|
||||
.expect("could not build connection to the session bus");
|
||||
|
||||
// run this in glib's main loop
|
||||
glib::spawn_future_local(glib::clone!(
|
||||
#[strong]
|
||||
conn,
|
||||
async move {
|
||||
loop {
|
||||
conn.executor().tick().await;
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
crate::Mpris::setup(conn.object_server(), &window)
|
||||
.await
|
||||
.expect("could not serve mpris");
|
||||
|
@ -49,10 +59,6 @@ mod imp {
|
|||
conn.request_name("org.mpris.MediaPlayer2.audrey")
|
||||
.await
|
||||
.expect("could not register name in session bus");
|
||||
|
||||
loop {
|
||||
conn.executor().tick().await;
|
||||
}
|
||||
});
|
||||
}
|
||||
Some(win) => win.present(),
|
||||
|
|
Loading…
Reference in a new issue