aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2013-04-05 14:11:02 +0000
committerTarmac <Unknown>2013-04-05 14:11:02 +0000
commit63616b0b258f640aa84150913f3d01cd79bb6c65 (patch)
tree4fa69148cfa06ee45d84728f2d2196e5be709e88 /src/player-controller.vala
parent6a225f960257026db4c5d57211b4159127bfc3a0 (diff)
parenteacbe640fa7ffb8a99a04ebf21f94982c3679a8c (diff)
downloadayatana-indicator-sound-63616b0b258f640aa84150913f3d01cd79bb6c65.tar.gz
ayatana-indicator-sound-63616b0b258f640aa84150913f3d01cd79bb6c65.tar.bz2
ayatana-indicator-sound-63616b0b258f640aa84150913f3d01cd79bb6c65.zip
MenuItem: use GtkLaunchContext with proper event timeout to launch applications
Also discards non-activation events. Fixes: https://bugs.launchpad.net/bugs/1163434. Approved by PS Jenkins bot, Lars Uebernickel.
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index fd66a8a..764efa5 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -98,11 +98,14 @@ public class PlayerController : GLib.Object
There is a need to wait before the application is on DBus before attempting to access its mpris address
Hence only when the it has registered with us via libindicate do we attempt to kick off mpris communication
*/
- public void instantiate()
+ public void instantiate(uint timestamp)
{
debug("instantiate in player controller for %s", this.app_info.get_name() );
+
try{
- this.app_info.launch(null, null);
+ var context = Gdk.Display.get_default().get_app_launch_context();
+ context.set_timestamp(timestamp);
+ this.app_info.launch(null, context);
this.update_state(state.INSTANTIATING);
}
catch(GLib.Error error){