Index: gio/gdesktopappinfo.c
===================================================================
--- gio/gdesktopappinfo.c	(revision 6873)
+++ gio/gdesktopappinfo.c	(working copy)
@@ -1,3 +1,5 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+
 /* GIO - GLib Input, Output and Streaming Library
  * 
  * Copyright (C) 2006-2007 Red Hat, Inc.
@@ -498,18 +500,51 @@
 {
   GList *uris = *uri_list;
   char *expanded;
-  
+  gboolean force_file_uri;
+  char force_file_uri_macro;
+
   g_return_if_fail (exec != NULL);
-  
+
+  /* On %u and %U, pass POSIX file path pointing to the URI via
+   * the FUSE mount in ~/.gvfs. Note that if the FUSE daemon isn't
+   * running or the URI doesn't have a POSIX file path via FUSE
+   * we'll just pass the URI.
+   */
   switch (macro)
     {
     case 'u':
+      force_file_uri_macro = 'f';
+      force_file_uri = TRUE;
+      break;
+    case 'U':
+      force_file_uri_macro = 'F';
+      force_file_uri = TRUE;
+      break;
+    default:
+      force_file_uri_macro = macro;
+      force_file_uri = FALSE;
+      break;
+    }
+
+  switch (macro)
+    {
+    case 'u':
     case 'f':
     case 'd':
     case 'n':
       if (uris)
 	{
-	  expanded = expand_macro_single (macro, uris->data);
+          if (!force_file_uri)
+            {
+              expanded = expand_macro_single (macro, uris->data);
+            }
+          else
+            {
+              expanded = expand_macro_single (force_file_uri_macro, uris->data);
+              if (expanded == NULL)
+                expanded = expand_macro_single (macro, uris->data);
+            }
+
 	  if (expanded)
 	    {
 	      g_string_append (exec, expanded);
@@ -526,7 +561,17 @@
     case 'N':
       while (uris)
 	{
-	  expanded = expand_macro_single (macro, uris->data);
+          if (!force_file_uri)
+            {
+              expanded = expand_macro_single (macro, uris->data);
+            }
+          else
+            {
+              expanded = expand_macro_single (force_file_uri_macro, uris->data);
+              if (expanded == NULL)
+                expanded = expand_macro_single (macro, uris->data);
+            }
+
 	  if (expanded)
 	    {
 	      g_string_append (exec, expanded);
Index: gio/ChangeLog
===================================================================
--- gio/ChangeLog	(revision 6873)
+++ gio/ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2008-04-29  David Zeuthen  <davidz@redhat.com>
+
+	* gdesktopappinfo.c (expand_macro): If available, always
+	pass the POSIX FUSE paths for %u and %U (#528670).
+
 2008-04-28  David Zeuthen  <davidz@redhat.com>
 
 	* gunixmounts.c (g_unix_mount_guess_should_display): Avoid
