diff -ur thunar-0.8.0_org/thunar-vfs/thunar-vfs-exec.c thunar-0.8.0/thunar-vfs/thunar-vfs-exec.c --- thunar-0.8.0_org/thunar-vfs/thunar-vfs-exec.c 2007-01-20 13:39:09.000000000 -0700 +++ thunar-0.8.0/thunar-vfs/thunar-vfs-exec.c 2007-11-14 19:21:56.000000000 -0700 @@ -481,8 +481,21 @@ } } } +#else + /* sn_envp needs to be duped in any case for DISPLAY below */ + sn_envp = g_strdupv(envp); #endif + if (sn_envp != NULL) + for (n = 0; sn_envp[n] != NULL; ++n) + if ((strlen (sn_envp[n]) > 7) && (g_strncasecmp ("DISPLAY", sn_envp[n], 7) == 0)) + { + gchar *dpyname = gdk_screen_make_display_name(screen); + g_free (sn_envp[n]); + sn_envp[n] = g_strconcat ("DISPLAY=", dpyname, NULL); + g_free (dpyname); + } + /* try to spawn the new process */ succeed = gdk_spawn_on_screen (screen, working_directory, argv, sn_envp, flags, NULL, NULL, &pid, error);