~indicator-applet-developers/indicator-messages/trunk.13.10

« back to all changes in this revision

Viewing changes to src/app-section.c

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2013-04-05 14:14:30 UTC
  • mfrom: (338.1.2 indicator-messages)
  • Revision ID: tarmac-20130405141430-0p8qwno5hpdt3wwh
AppSection: use the GAppLaunchContext with event timestamp when launching an app. Fixes: https://bugs.launchpad.net/bugs/627195, https://bugs.launchpad.net/bugs/811461.

Approved by PS Jenkins bot, Lars Uebernickel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "config.h"
26
26
#endif
27
27
 
 
28
#include <gdk/gdk.h>
28
29
#include <glib/gi18n.h>
29
30
#include <gio/gdesktopappinfo.h>
30
31
#include <gio/gio.h>
390
391
        g_simple_action_group_clear (priv->static_shortcuts);
391
392
 
392
393
        is_running = priv->name_watch_id > 0;
393
 
        launch = g_simple_action_new_stateful ("launch", NULL, g_variant_new_boolean (is_running));
 
394
        launch = g_simple_action_new_stateful ("launch", G_VARIANT_TYPE_UINT32, g_variant_new_boolean (is_running));
394
395
        g_signal_connect (launch, "activate", G_CALLBACK (activate_cb), self);
395
396
        g_signal_connect (launch, "change-state", G_CALLBACK (launch_action_change_state), self);
396
397
        g_simple_action_group_insert (priv->static_shortcuts, G_ACTION (launch));
506
507
        AppSection * mi = APP_SECTION (userdata);
507
508
        AppSectionPrivate * priv = mi->priv;
508
509
        GError *error = NULL;
509
 
 
510
 
        if (!g_app_info_launch (G_APP_INFO (priv->appinfo), NULL, NULL, &error)) {
 
510
        GdkDisplay *display = gdk_display_get_default();
 
511
        GdkAppLaunchContext *launch_context = gdk_display_get_app_launch_context (display);
 
512
 
 
513
        gdk_app_launch_context_set_timestamp (launch_context, g_variant_get_uint32 (param));
 
514
 
 
515
        if (!g_app_info_launch (G_APP_INFO (priv->appinfo), NULL, G_APP_LAUNCH_CONTEXT (launch_context), &error)) {
511
516
                g_warning("Unable to execute application for desktop file '%s': %s",
512
517
                          g_desktop_app_info_get_filename (priv->appinfo),
513
518
                          error->message);
514
519
                g_error_free (error);
515
520
        }
 
521
 
 
522
        g_object_unref (launch_context);
516
523
}
517
524
 
518
525
static void