From e6779eca9277231ee59c6441bf6982599a0d611e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sat, 30 Mar 2013 20:15:23 +0100 Subject: PlayerController use GtkApplicationPlayer and activate it when we need to raise --- src/metadata-menu-item.vala | 3 ++- src/mpris2-controller.vala | 4 ++-- src/player-controller.vala | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala index bcd4378..a81c143 100644 --- a/src/metadata-menu-item.vala +++ b/src/metadata-menu-item.vala @@ -176,7 +176,8 @@ public class MetadataMenuitem : PlayerItem { this.owner.instantiate(timestamp); } - else if(this.owner.current_state == PlayerController.state.CONNECTED){ + else if (this.owner.current_state == PlayerController.state.CONNECTED) { + this.owner.gtk_app_player.activate(timestamp); this.owner.mpris_bridge.expose(timestamp); } } diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala index 5015f80..9230a59 100644 --- a/src/mpris2-controller.vala +++ b/src/mpris2-controller.vala @@ -208,9 +208,9 @@ public class Mpris2Controller : GLib.Object return (this.player != null && this.mpris2_root != null); } - public void expose(uint timestamp) + public void expose(uint timestmap) { - if(this.connected() == true){ + if (this.connected() == true) { this.mpris2_root.Raise.begin(); } } diff --git a/src/player-controller.vala b/src/player-controller.vala index 764efa5..dbe7c3c 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -45,6 +45,7 @@ public class PlayerController : GLib.Object public string dbus_name { get; set;} public ArrayList custom_items; public Mpris2Controller mpris_bridge; + public GtkApplicationPlayer gtk_app_player; public AppInfo? app_info { get; set;} public int menu_offset { get; set;} public string icon_name { get; set; } @@ -149,6 +150,7 @@ public class PlayerController : GLib.Object debug ( " establish mpris connection - use playlists value = %s ", this.use_playlists.to_string() ); this.mpris_bridge = new Mpris2Controller (this); + this.gtk_app_player = new GtkApplicationPlayer (this); this.determine_state (); } -- cgit v1.2.3