diff options
author | Mark McLoughlin <mark@skynet.ie> | 2002-10-02 05:36:58 +0000 |
---|---|---|
committer | Mark McLoughlin <mmclouglin@src.gnome.org> | 2002-10-02 05:36:58 +0000 |
commit | 3e6bfd6af629583e51a1120ee407ccfbaeec1b27 (patch) | |
tree | d03148f8d07673a8c97cfa75de1d890213b9e8a7 /libnautilus-private/nautilus-program-choosing.c | |
parent | 3fa3cfe91a6f995ce99dedbd5f3609dccb6dec72 (diff) | |
download | nautilus-3e6bfd6af629583e51a1120ee407ccfbaeec1b27.tar.gz |
Merge the multihead branch into HEAD and :
2002-10-02 Mark McLoughlin <mark@skynet.ie>
* acconfig.h: define HAVE_GTK_MULTIHEAD for
egg-screen-exec methods.
* configure.in: require gtk 2.1.0 and don't
define HAVE_GTK_MULTIHEAD.
* libnautilus-private/nautilus-multihead-hacks.h: kill.
* libnautilus-private/nautilus-directory-background:
(make_root_pixmap), (set_root_pixmap): use
gdk_screen_get_display instead of assuming the default
display.
* src/nautilus-shell.c: (restore_one_window_callback):
add backwards compat support for sessions without
a screen number.
Diffstat (limited to 'libnautilus-private/nautilus-program-choosing.c')
-rw-r--r-- | libnautilus-private/nautilus-program-choosing.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/libnautilus-private/nautilus-program-choosing.c b/libnautilus-private/nautilus-program-choosing.c index d43ef76ea..1d7b11767 100644 --- a/libnautilus-private/nautilus-program-choosing.c +++ b/libnautilus-private/nautilus-program-choosing.c @@ -29,6 +29,7 @@ #include "nautilus-mime-actions.h" #include "nautilus-program-chooser.h" #include "nautilus-global-preferences.h" +#include "egg-screen-exec.h" #include <eel/eel-glib-extensions.h> #include <eel/eel-gnome-extensions.h> #include <eel/eel-vfs-extensions.h> @@ -539,8 +540,9 @@ nautilus_launch_application (GnomeVFSMimeApplication *application, NautilusFile *file, GtkWindow *parent_window) { - char *parameter; - char *uri_scheme, *uri; + GdkScreen *screen; + char *parameter; + char *uri_scheme, *uri; uri_scheme = nautilus_file_get_uri_scheme (file); @@ -586,7 +588,10 @@ nautilus_launch_application (GnomeVFSMimeApplication *application, } g_free (uri_scheme); - nautilus_launch_application_from_command (application->name, + screen = gtk_window_get_screen (parent_window); + + nautilus_launch_application_from_command (screen, + application->name, application->command, parameter, application->requires_terminal); @@ -607,7 +612,8 @@ nautilus_launch_application (GnomeVFSMimeApplication *application, * @parameter: Passed as a parameter to the application as is. */ void -nautilus_launch_application_from_command (const char *name, +nautilus_launch_application_from_command (GdkScreen *screen, + const char *name, const char *command_string, const char *parameter, gboolean use_terminal) @@ -624,18 +630,19 @@ nautilus_launch_application_from_command (const char *name, } if (use_terminal) { - eel_gnome_open_terminal (full_command); + eel_gnome_open_terminal_on_screen (full_command, screen); } else { - eel_gnome_shell_execute (full_command); + eel_gnome_shell_execute_on_screen (full_command, screen); } g_free (full_command); } void -nautilus_launch_desktop_file (const char *desktop_file_uri, - const GList *parameter_uris, - GtkWindow *parent_window) +nautilus_launch_desktop_file (GdkScreen *screen, + const char *desktop_file_uri, + const GList *parameter_uris, + GtkWindow *parent_window) { GError *error; GnomeDesktopItem *ditem; @@ -644,6 +651,7 @@ nautilus_launch_desktop_file (const char *desktop_file_uri, char *local_path, *message; const GList *p; int total, count; + char **envp; /* strip the leading command specifier */ if (eel_str_has_prefix (desktop_file_uri, NAUTILUS_DESKTOP_COMMAND_SPECIFIER)) { @@ -721,6 +729,8 @@ nautilus_launch_desktop_file (const char *desktop_file_uri, parent_window); } } + + envp = egg_screen_exec_environment (screen); /* we append local paths only if all parameters are local */ if (count == total) { @@ -730,10 +740,9 @@ nautilus_launch_desktop_file (const char *desktop_file_uri, } error = NULL; - gnome_desktop_item_launch (ditem, (GList *) parameter_uris, - flags, - &error); - + gnome_desktop_item_launch_with_env (ditem, (GList *) parameter_uris, + flags, envp, + &error); if (error != NULL) { message = g_strconcat (_("There was an error launching the application.\n\n" "Details: "), error->message, NULL); @@ -747,4 +756,5 @@ nautilus_launch_desktop_file (const char *desktop_file_uri, } gnome_desktop_item_unref (ditem); + g_strfreev (envp); } |