aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2013-03-30 20:15:23 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2013-03-30 20:15:23 +0100
commite6779eca9277231ee59c6441bf6982599a0d611e (patch)
tree25c0ad66b22998c528c05aabcd6d4e9edaf30b1e
parentfab924562a7db79a96ec367d28601fd6433e9c51 (diff)
downloadayatana-indicator-sound-e6779eca9277231ee59c6441bf6982599a0d611e.tar.gz
ayatana-indicator-sound-e6779eca9277231ee59c6441bf6982599a0d611e.tar.bz2
ayatana-indicator-sound-e6779eca9277231ee59c6441bf6982599a0d611e.zip
PlayerController use GtkApplicationPlayer and activate it when we need to raise
-rw-r--r--src/metadata-menu-item.vala3
-rw-r--r--src/mpris2-controller.vala4
-rw-r--r--src/player-controller.vala2
3 files changed, 6 insertions, 3 deletions
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<PlayerItem> 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 ();
}