static ShellApp *
get_app_from_gapplication_id (MetaWindow  *window)
{
  ShellApp *app;
  ShellAppSystem *appsys;
  const char *id;
  char *desktop_file;

  appsys = shell_app_system_get_default ();

  id = meta_window_get_gtk_application_id (window);
  if (!id)
    return FALSE;

  desktop_file = g_strconcat (id, ".desktop", NULL);
  app = shell_app_system_lookup_app (appsys, desktop_file);

  g_free (desktop_file);
  return app;
}
/**
 * get_app_from_gapplication_id:
 * @monitor: a #CinnamonWindowTracker
 * @window: a #MetaWindow
 *
 * Looks only at the given window, and attempts to determine
 * an application based on _GTK_APPLICATION_ID.  If one can't be determined,
 * return %NULL.
 *
 * Return value: (transfer full): A newly-referenced #CinnamonApp, or %NULL
 */
static CinnamonApp *
get_app_from_gapplication_id (MetaWindow  *window)
{
  CinnamonApp *app;
  CinnamonAppSystem *appsys;
  const char *id;
  char *desktop_file;

  appsys = cinnamon_app_system_get_default ();

  id = meta_window_get_gtk_application_id (window);
  if (!id)
    return NULL;

  desktop_file = g_strconcat (id, ".desktop", NULL);
  app = cinnamon_app_system_lookup_app (appsys, desktop_file);
  if (app)
    g_object_ref (app);

  g_free (desktop_file);
  return app;
}