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")]
|
||||
impl Mpris {
|
||||
async fn raise(&self) {
|
||||
// TODO: don't unwrap
|
||||
self.window.upgrade().unwrap().present();
|
||||
fn raise(&self) {
|
||||
self.window.upgrade().expect("main window was finalized").present();
|
||||
}
|
||||
|
||||
async fn quit(&self) {
|
||||
// TODO: don't unwrap
|
||||
self.window.upgrade().unwrap().close();
|
||||
fn quit(&self) {
|
||||
match self.window.upgrade() {
|
||||
None => {}, // guess there's nothing to do
|
||||
Some(window) => window.close(),
|
||||
}
|
||||
}
|
||||
|
||||
#[zbus(property)]
|
||||
|
@ -40,7 +41,8 @@ impl Mpris {
|
|||
|
||||
#[zbus(property)]
|
||||
// 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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue