diff options
author | Alexander Larsson <alexl@redhat.com> | 2002-08-29 10:15:42 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2002-08-29 10:15:42 +0000 |
commit | e4ae51202629a987a62b3193897b588eec07c0a2 (patch) | |
tree | cda0864105e43b7d08bfe12d5c71b55d8720185b | |
parent | a31c78c2dddf7270d977c2e0d97a443f80e6a62c (diff) | |
download | nautilus-e4ae51202629a987a62b3193897b588eec07c0a2.tar.gz |
Allow other apps that do their own CD switching to temporary disable
2002-08-29 Alexander Larsson <alexl@redhat.com>
* src/nautilus-application.c (volume_mounted_callback):
Allow other apps that do their own CD switching to temporary disable
nautilus from popping up CD windows by grabbing the
_NAUTILUS_DISABLE_MOUNT_WINDOW selection.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/nautilus-application.c | 19 |
2 files changed, 25 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2002-08-29 Alexander Larsson <alexl@redhat.com> + + * src/nautilus-application.c (volume_mounted_callback): + Allow other apps that do their own CD switching to temporary disable + nautilus from popping up CD windows by grabbing the + _NAUTILUS_DISABLE_MOUNT_WINDOW selection. + === nautilus 2.0.6 === 2002-08-28 Alexander Larsson <alexl@redhat.com> diff --git a/src/nautilus-application.c b/src/nautilus-application.c index ffb39fca0..43f575bcb 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -46,6 +46,7 @@ #include <eel/eel-string.h> #include <eel/eel-vfs-extensions.h> #include <eel/eel-gtk-extensions.h> +#include <gdk/gdkx.h> #include <gtk/gtksignal.h> #include <libgnome/gnome-config.h> #include <libgnome/gnome-i18n.h> @@ -826,6 +827,21 @@ need_to_show_first_time_druid (void) return result; } +/* Apps like redhat-config-packages that are using the CD-ROM + * directly, can grab ownership of the _NAUTILUS_DISABLE_MOUNT_WINDOW + * selection to temporarily disable the new window behavior. + */ +static gboolean +check_mount_window_disabled (void) +{ + Atom selection_atom = gdk_x11_get_xatom_by_name ("_NAUTILUS_DISABLE_MOUNT_WINDOW"); + + if (XGetSelectionOwner (GDK_DISPLAY(), selection_atom) != None) + return TRUE; + else + return FALSE; +} + static void volume_mounted_callback (NautilusVolumeMonitor *monitor, NautilusVolume *volume, NautilusApplication *application) @@ -839,7 +855,8 @@ volume_mounted_callback (NautilusVolumeMonitor *monitor, NautilusVolume *volume, /* Open a window to the CD if the user has set that preference. */ if (nautilus_volume_get_device_type (volume) == NAUTILUS_DEVICE_CDROM_DRIVE - && eel_gconf_get_boolean( "/apps/magicdev/do_fileman_window")) { + && eel_gconf_get_boolean( "/apps/magicdev/do_fileman_window") + && !check_mount_window_disabled ()) { window = nautilus_application_create_window (application); uri = gnome_vfs_get_uri_from_local_path (nautilus_volume_get_mount_path (volume)); nautilus_window_go_to (window, uri); |