From eacbe640fa7ffb8a99a04ebf21f94982c3679a8c Mon Sep 17 00:00:00 2001 From: "Marco Trevisan (TreviƱo)" Date: Sat, 30 Mar 2013 19:25:21 +0100 Subject: MenuItem: use GtkLaunchContext with proper event timeout to launch applications Also discards non-activation events --- src/player-controller.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/player-controller.vala') 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){ -- cgit v1.2.3