Commit e4ae5120 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

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.
parent a31c78c2
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>
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment