aboutsummaryrefslogtreecommitdiff
path: root/src/launcher-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-20 10:25:07 -0500
committerTed Gould <ted@canonical.com>2009-08-20 10:25:07 -0500
commit8483b2d92f9b86e6d00afc163b835a47e1bebdbe (patch)
tree0a458833dcc2570df2f2ede3ec3a07e3e3f3fe48 /src/launcher-menu-item.c
parentc49644e5e7a901c2113d6d0a88e54b4224f90de5 (diff)
downloadayatana-indicator-messages-8483b2d92f9b86e6d00afc163b835a47e1bebdbe.tar.gz
ayatana-indicator-messages-8483b2d92f9b86e6d00afc163b835a47e1bebdbe.tar.bz2
ayatana-indicator-messages-8483b2d92f9b86e6d00afc163b835a47e1bebdbe.zip
Use a GDK app context. Not sure about the timestamp units though.
Diffstat (limited to 'src/launcher-menu-item.c')
-rw-r--r--src/launcher-menu-item.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c
index 4f05ae6..653592c 100644
--- a/src/launcher-menu-item.c
+++ b/src/launcher-menu-item.c
@@ -24,6 +24,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#endif
+#include <gdk/gdk.h>
#include <glib/gi18n.h>
#include <gio/gdesktopappinfo.h>
#include "launcher-menu-item.h"
@@ -156,12 +157,23 @@ activate_cb (LauncherMenuItem * self, gpointer data)
LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(self);
g_return_if_fail(priv->appinfo != NULL);
+ /* This should manage the X stuff for us */
+ GdkAppLaunchContext * context = gdk_app_launch_context_new();
+
+ /* Using the current time as we don't have the event
+ time as that's not sent across the bus */
+ GTimeVal time;
+ g_get_current_time(&time);
+ gdk_app_launch_context_set_timestamp(context, time.tv_usec);
+
GError * error = NULL;
- if (!g_app_info_launch(priv->appinfo, NULL, NULL, &error)) {
+ if (!g_app_info_launch(priv->appinfo, NULL, G_APP_LAUNCH_CONTEXT(context), &error)) {
g_warning("Application failed to launch '%s' because: %s", launcher_menu_item_get_name(self), error->message);
g_error_free(error);
}
+ g_object_unref(G_OBJECT(context));
+
return;
}