some fixes
This commit is contained in:
parent
62c71dbd26
commit
56d4057d87
1 changed files with 9 additions and 7 deletions
16
src/mpris.rs
16
src/mpris.rs
|
@ -18,14 +18,15 @@ impl Mpris {
|
||||||
|
|
||||||
#[zbus::interface(name = "org.mpris.MediaPlayer2")]
|
#[zbus::interface(name = "org.mpris.MediaPlayer2")]
|
||||||
impl Mpris {
|
impl Mpris {
|
||||||
async fn raise(&self) {
|
fn raise(&self) {
|
||||||
// TODO: don't unwrap
|
self.window.upgrade().expect("main window was finalized").present();
|
||||||
self.window.upgrade().unwrap().present();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn quit(&self) {
|
fn quit(&self) {
|
||||||
// TODO: don't unwrap
|
match self.window.upgrade() {
|
||||||
self.window.upgrade().unwrap().close();
|
None => {}, // guess there's nothing to do
|
||||||
|
Some(window) => window.close(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
|
@ -40,7 +41,8 @@ impl Mpris {
|
||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
// TODO: report that if the argument is just _ the attribute panics
|
// TODO: report that if the argument is just _ the attribute panics
|
||||||
async fn set_fullscreen(&self, _fullscreen: bool) -> zbus::Result<()> {
|
// TODO: why can't this return zbus::fdo::Result??
|
||||||
|
fn set_fullscreen(&self, _fullscreen: bool) -> zbus::Result<()> {
|
||||||
Err(zbus::Error::Unsupported)
|
Err(zbus::Error::Unsupported)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue