some fixes

This commit is contained in:
Erica Z 2024-11-01 13:02:27 +01:00
parent 62c71dbd26
commit 56d4057d87

View file

@ -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)
}