Mpris: Actually raise the window

This fixes a bug where can_raise was never registered on dbus,
but it also works around a wayland issue with the .present()
method.

https://gitlab.gnome.org/GNOME/gtk/issues/624
This commit is contained in:
Jordan Petridis 2018-11-04 21:05:09 +02:00
parent 6671f8c6fe
commit 5ac4f6dcf9
No known key found for this signature in database
GPG Key ID: E8523968931763BE
2 changed files with 3 additions and 1 deletions

View File

@ -391,7 +391,8 @@ impl App {
self.headerbar.switch.set_sensitive(true); self.headerbar.switch.set_sensitive(true);
self.content.switch_to_populated(); self.content.switch_to_populated();
} }
Action::RaiseWindow => self.window.present(), // https://gitlab.gnome.org/GNOME/gtk/issues/624#note_109968
Action::RaiseWindow => self.window.present_with_time((glib::get_monotonic_time() / 1000) as u32),
} }
} }

View File

@ -220,6 +220,7 @@ impl Default for PlayerWidget {
"GNOME Podcasts".to_string(), "GNOME Podcasts".to_string(),
"org.gnome.Podcasts.desktop".to_string(), "org.gnome.Podcasts.desktop".to_string(),
); );
mpris.set_can_raise(true);
mpris.set_can_play(false); mpris.set_can_play(false);
mpris.set_can_seek(false); mpris.set_can_seek(false);
mpris.set_can_set_fullscreen(false); mpris.set_can_set_fullscreen(false);