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

Merge some stuff from the redhat-outstanding-patches branch

2001-09-05  Alex Larsson  <alexl@redhat.com>

	Merge some stuff from the redhat-outstanding-patches branch

	* eazel-logos/default.xml:
	* icons/default.xml:
	don't hardcode the title, title info, and
	shadow colors; this prevented the auto-color-selection stuff
	in nautilus-sidebar-title.c from working properly.
	And the hardcoded values were the same thing the autoselector
	would have chosen anyhow.

	* libnautilus-private/nautilus-monitor.c:
	Don't monitor files on read only volumes, they never change, and
	will keep cdroms from being unmounted because fam has open file
	descriptors on them.

	* libnautilus-private/nautilus-thumbnails.c:
	Always look for local thumbnails first.

	* libnautilus-private/nautilus-volume-monitor.[ch]:
	Add nautilus_volume_is_read_only() and
	nautilus_volume_monitor_get_volume_for_path()

	* src/nautilus-desktop-window.c:
	(set_wmspec_desktop_hint): function to set _NET_WM_WINDOW_TYPE, to
	avoid confusing kwin so badly, and also to go ahead and support
	the Window Manager Hints Of The Future.
	(set_gdk_window_background): only set root background to a pixel
	if we retrieved a pixel property
	(map): Set background of our child widgets in addition to our
	own background. This gets rid of the last of the ugliness during
	Nautilus startup, I believe.

	* src/file-manager/fm-icon-view.c:
	Don't read GMC position meta data -- it is never right for nautilus,
	due to different size icons, additional icons, different placement
	policies, so falling back to normal automatic placement works better.
parent ffaa43d0
2001-09-05 Alex Larsson <alexl@redhat.com>
Merge some stuff from the redhat-outstanding-patches branch
* eazel-logos/default.xml:
* icons/default.xml:
don't hardcode the title, title info, and
shadow colors; this prevented the auto-color-selection stuff
in nautilus-sidebar-title.c from working properly.
And the hardcoded values were the same thing the autoselector
would have chosen anyhow.
* libnautilus-private/nautilus-monitor.c:
Don't monitor files on read only volumes, they never change, and
will keep cdroms from being unmounted because fam has open file
descriptors on them.
* libnautilus-private/nautilus-thumbnails.c:
Always look for local thumbnails first.
* libnautilus-private/nautilus-volume-monitor.[ch]:
Add nautilus_volume_is_read_only() and
nautilus_volume_monitor_get_volume_for_path()
* src/nautilus-desktop-window.c:
(set_wmspec_desktop_hint): function to set _NET_WM_WINDOW_TYPE, to
avoid confusing kwin so badly, and also to go ahead and support
the Window Manager Hints Of The Future.
(set_gdk_window_background): only set root background to a pixel
if we retrieved a pixel property
(map): Set background of our child widgets in addition to our
own background. This gets rid of the last of the ugliness during
Nautilus startup, I believe.
* src/file-manager/fm-icon-view.c:
Don't read GMC position meta data -- it is never right for nautilus,
due to different size icons, additional icons, different placement
policies, so falling back to normal automatic placement works better.
2001-09-07 Darin Adler <darin@bentspoon.com> 2001-09-07 Darin Adler <darin@bentspoon.com>
* .cvsignore: * .cvsignore:
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
<sidebar sidebar_background_tile_image="./side_bar_image.png" <sidebar sidebar_background_tile_image="./side_bar_image.png"
sidebar_background_color="rgb:4747/4A4A/7C7C-rgb:2222/2323/3A3A:h" sidebar_background_color="rgb:4747/4A4A/7C7C-rgb:2222/2323/3A3A:h"
title_color="rgb:FFFF/FFFF/FFFF"
title_info_color="rgb:FFFF/FFFF/FFFF"
title_shadow_color="rgb:0000/0000/0000"
tab_piece_images="sidebar_tab_pieces" combine="true" tab_piece_images="sidebar_tab_pieces" combine="true"
left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF" left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF"
tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" />
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
<sidebar sidebar_background_tile_image="./side_bar_image.png" <sidebar sidebar_background_tile_image="./side_bar_image.png"
sidebar_background_color="rgb:4747/4A4A/7C7C-rgb:2222/2323/3A3A:h" sidebar_background_color="rgb:4747/4A4A/7C7C-rgb:2222/2323/3A3A:h"
title_color="rgb:FFFF/FFFF/FFFF"
title_info_color="rgb:FFFF/FFFF/FFFF"
title_shadow_color="rgb:0000/0000/0000"
tab_piece_images="sidebar_tab_pieces" combine="true" tab_piece_images="sidebar_tab_pieces" combine="true"
left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF" left_offset="0" shadow_offset="1" text_h_offset="-4" label_color="rgb:FFFF/FFFF/FFFF"
tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" /> tab_font="-*-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*" />
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#ifdef HAVE_LIBFAM #ifdef HAVE_LIBFAM
#include "nautilus-file-changes-queue.h" #include "nautilus-file-changes-queue.h"
#include "nautilus-volume-monitor.h"
#include <fam.h> #include <fam.h>
#include <gdk/gdk.h> #include <gdk/gdk.h>
#include <gmodule.h> #include <gmodule.h>
...@@ -232,6 +233,17 @@ nautilus_monitor_active (void) ...@@ -232,6 +233,17 @@ nautilus_monitor_active (void)
#endif #endif
} }
static gboolean
path_is_on_readonly_volume (const char *path)
{
NautilusVolumeMonitor *volume_monitor;
NautilusVolume *volume;
volume_monitor = nautilus_volume_monitor_get ();
volume = nautilus_volume_monitor_get_volume_for_path (volume_monitor, path);
return (volume != NULL) && nautilus_volume_is_read_only (volume);
}
NautilusMonitor * NautilusMonitor *
nautilus_monitor_file (const char *uri) nautilus_monitor_file (const char *uri)
{ {
...@@ -251,7 +263,16 @@ nautilus_monitor_file (const char *uri) ...@@ -251,7 +263,16 @@ nautilus_monitor_file (const char *uri)
if (path == NULL) { if (path == NULL) {
return NULL; return NULL;
} }
/* Check to see if the file system is readonly. If so, don't monitor --
* there is no point, and we'll just keep the file system busy for
* no reason, preventing unmounting
*/
if (path_is_on_readonly_volume (path)) {
g_free (path);
return NULL;
}
monitor = g_new0 (NautilusMonitor, 1); monitor = g_new0 (NautilusMonitor, 1);
FAMMonitorFile (connection, path, &monitor->request, NULL); FAMMonitorFile (connection, path, &monitor->request, NULL);
...@@ -283,6 +304,15 @@ nautilus_monitor_directory (const char *uri) ...@@ -283,6 +304,15 @@ nautilus_monitor_directory (const char *uri)
return NULL; return NULL;
} }
/* Check to see if the file system is readonly. If so, don't monitor --
* there is no point, and we'll just keep the file system busy for
* no reason, preventing unmounting
*/
if (path_is_on_readonly_volume (path)) {
g_free (path);
return NULL;
}
monitor = g_new0 (NautilusMonitor, 1); monitor = g_new0 (NautilusMonitor, 1);
FAMMonitorDirectory (connection, path, &monitor->request, NULL); FAMMonitorDirectory (connection, path, &monitor->request, NULL);
......
...@@ -94,7 +94,7 @@ uri_is_local (const char *uri) ...@@ -94,7 +94,7 @@ uri_is_local (const char *uri)
is_local = gnome_vfs_uri_is_local (vfs_uri); is_local = gnome_vfs_uri_is_local (vfs_uri);
gnome_vfs_uri_unref (vfs_uri); gnome_vfs_uri_unref (vfs_uri);
return is_local; return is_local;
} }
static gboolean static gboolean
...@@ -327,7 +327,7 @@ nautilus_get_thumbnail_uri (NautilusFile *file) ...@@ -327,7 +327,7 @@ nautilus_get_thumbnail_uri (NautilusFile *file)
file_uri = nautilus_file_get_uri (file); file_uri = nautilus_file_get_uri (file);
thumbnail_uri = make_thumbnail_uri (file_uri, FALSE, uri_is_local (file_uri), TRUE); thumbnail_uri = make_thumbnail_uri (file_uri, FALSE, TRUE, TRUE);
/* if the thumbnail file already exists locally, simply return the uri */ /* if the thumbnail file already exists locally, simply return the uri */
......
...@@ -157,7 +157,9 @@ struct NautilusVolume { ...@@ -157,7 +157,9 @@ struct NautilusVolume {
char *device_path; char *device_path;
char *mount_path; char *mount_path;
char *volume_name; char *volume_name;
dev_t device;
gboolean is_read_only;
gboolean is_removable; gboolean is_removable;
gboolean is_audio_cd; gboolean is_audio_cd;
}; };
...@@ -211,6 +213,7 @@ static GList * finish_creating_volume_and_prepend (NautilusVolumeM ...@@ -211,6 +213,7 @@ static GList * finish_creating_volume_and_prepend (NautilusVolumeM
static NautilusVolume *copy_volume (const NautilusVolume *volume); static NautilusVolume *copy_volume (const NautilusVolume *volume);
static void find_volumes (NautilusVolumeMonitor *monitor); static void find_volumes (NautilusVolumeMonitor *monitor);
static void free_mount_list (GList *mount_list); static void free_mount_list (GList *mount_list);
static GList * copy_mount_list (GList *mount_list);
static GList * get_removable_volumes (NautilusVolumeMonitor *monitor); static GList * get_removable_volumes (NautilusVolumeMonitor *monitor);
static GHashTable * create_readable_mount_point_name_table (void); static GHashTable * create_readable_mount_point_name_table (void);
static int get_cdrom_type (const char *vol_dev_path, static int get_cdrom_type (const char *vol_dev_path,
...@@ -419,6 +422,13 @@ nautilus_volume_is_removable (const NautilusVolume *volume) ...@@ -419,6 +422,13 @@ nautilus_volume_is_removable (const NautilusVolume *volume)
return volume->is_removable; return volume->is_removable;
} }
gboolean
nautilus_volume_is_read_only (const NautilusVolume *volume)
{
return volume->is_read_only;
}
/* nautilus_volume_monitor_get_removable_volumes /* nautilus_volume_monitor_get_removable_volumes
* *
* Accessor. List and internal data is not to be freed. * Accessor. List and internal data is not to be freed.
...@@ -430,6 +440,40 @@ nautilus_volume_monitor_get_removable_volumes (NautilusVolumeMonitor *monitor) ...@@ -430,6 +440,40 @@ nautilus_volume_monitor_get_removable_volumes (NautilusVolumeMonitor *monitor)
return monitor->details->removable_volumes; return monitor->details->removable_volumes;
} }
/**
* nautilus_volume_monitor_get_volume_for_path:
* @path: a local filesystem path
*
* Find the volume in which @path resides.
*
* Return value: a NautilusVolume for @path, or %NULL if the operation
* fails, probably because stat() fails on @path.
*
**/
NautilusVolume *
nautilus_volume_monitor_get_volume_for_path (NautilusVolumeMonitor *monitor,
const char *path)
{
struct stat statbuf;
dev_t device;
GList *p;
NautilusVolume *volume;
if (stat (path, &statbuf) != 0)
return NULL;
device = statbuf.st_dev;
for (p = monitor->details->mounts; p != NULL; p = p->next) {
volume = (NautilusVolume *) p->data;
if (volume->device == device) {
return volume;
}
}
return NULL;
}
#if defined (HAVE_GETMNTINFO) || defined (HAVE_MNTENT_H) || defined (SOLARIS_MNT) #if defined (HAVE_GETMNTINFO) || defined (HAVE_MNTENT_H) || defined (SOLARIS_MNT)
...@@ -805,6 +849,23 @@ free_mount_list (GList *mount_list) ...@@ -805,6 +849,23 @@ free_mount_list (GList *mount_list)
g_list_free (mount_list); g_list_free (mount_list);
} }
static GList *
copy_mount_list (GList *mount_list)
{
GList *new_list = NULL;
GList *list = mount_list;
NautilusVolume *volume;
while (list) {
volume = list->data;
new_list = g_list_prepend (new_list, copy_volume (volume));
list = list->next;
}
return g_list_reverse (new_list);
}
/* List returned, but not the data it contains, must be freed by caller */ /* List returned, but not the data it contains, must be freed by caller */
static GList * static GList *
...@@ -876,18 +937,43 @@ get_mount_list (NautilusVolumeMonitor *monitor) ...@@ -876,18 +937,43 @@ get_mount_list (NautilusVolumeMonitor *monitor)
#else /* !SOLARIS_MNT */ #else /* !SOLARIS_MNT */
static gboolean
option_list_has_option (const char *optlist,
const char *option)
{
gboolean retval = FALSE;
char **options;
int i;
options = g_strsplit (optlist, ",", -1);
for (i = 0; options[i]; i++) {
if (!strcmp (options[i], option)) {
retval = TRUE;
break;
}
}
g_strfreev (options);
return retval;
}
static GList * static GList *
get_mount_list (NautilusVolumeMonitor *monitor) get_mount_list (NautilusVolumeMonitor *monitor)
{ {
GList *volumes; GList *volumes;
NautilusVolume *volume; NautilusVolume *volume;
static time_t last_mtime = 0;
static FILE *fh = NULL; static FILE *fh = NULL;
static GList *saved_list = NULL;
const char *file_name; const char *file_name;
const char *separator; const char *separator;
char line[PATH_MAX * 3]; char line[PATH_MAX * 3];
char device_name[sizeof (line)]; char device_name[sizeof (line)];
EelStringList *list; EelStringList *list;
char *device_path, *mount_path, *file_system_type_name; char *device_path, *mount_path, *file_system_type_name;
struct stat sb;
volumes = NULL; volumes = NULL;
...@@ -898,6 +984,21 @@ get_mount_list (NautilusVolumeMonitor *monitor) ...@@ -898,6 +984,21 @@ get_mount_list (NautilusVolumeMonitor *monitor)
file_name = "/proc/mounts"; file_name = "/proc/mounts";
separator = " "; separator = " ";
} }
/* /proc/mounts mtime never changes, so stat /etc/mtab.
* Isn't this lame?
*/
if (stat ("/etc/mtab", &sb) < 0) {
g_warning ("Unable to stat %s: %s", file_name,
g_strerror (errno));
return NULL;
}
if (sb.st_mtime == last_mtime) {
return copy_mount_list (saved_list);
}
last_mtime = sb.st_mtime;
if (fh == NULL) { if (fh == NULL) {
fh = fopen (file_name, "r"); fh = fopen (file_name, "r");
...@@ -905,7 +1006,7 @@ get_mount_list (NautilusVolumeMonitor *monitor) ...@@ -905,7 +1006,7 @@ get_mount_list (NautilusVolumeMonitor *monitor)
g_warning ("Unable to open %s: %s", file_name, strerror (errno)); g_warning ("Unable to open %s: %s", file_name, strerror (errno));
return NULL; return NULL;
} }
} else { } else {
rewind (fh); rewind (fh);
} }
...@@ -927,8 +1028,12 @@ get_mount_list (NautilusVolumeMonitor *monitor) ...@@ -927,8 +1028,12 @@ get_mount_list (NautilusVolumeMonitor *monitor)
mount_path = eel_string_list_nth (list, 1); mount_path = eel_string_list_nth (list, 1);
file_system_type_name = eel_string_list_nth (list, 2); file_system_type_name = eel_string_list_nth (list, 2);
volume = create_volume (device_path, mount_path); volume = create_volume (device_path, mount_path);
if (eel_string_list_get_length (list) >= 4 &&
option_list_has_option (eel_string_list_nth (list, 3), MNTOPT_RO))
volume->is_read_only = TRUE;
volumes = finish_creating_volume_and_prepend volumes = finish_creating_volume_and_prepend
(monitor, volume, file_system_type_name, volumes); (monitor, volume, file_system_type_name, volumes);
g_free (device_path); g_free (device_path);
g_free (mount_path); g_free (mount_path);
g_free (file_system_type_name); g_free (file_system_type_name);
...@@ -936,8 +1041,11 @@ get_mount_list (NautilusVolumeMonitor *monitor) ...@@ -936,8 +1041,11 @@ get_mount_list (NautilusVolumeMonitor *monitor)
eel_string_list_free (list); eel_string_list_free (list);
} }
return volumes; free_mount_list (saved_list);
saved_list = volumes;
return copy_mount_list (volumes);
} }
#endif /* !SOLARIS_MNT */ #endif /* !SOLARIS_MNT */
...@@ -1508,7 +1616,8 @@ copy_volume (const NautilusVolume *volume) ...@@ -1508,7 +1616,8 @@ copy_volume (const NautilusVolume *volume)
new_volume->device_path = g_strdup (volume->device_path); new_volume->device_path = g_strdup (volume->device_path);
new_volume->mount_path = g_strdup (volume->mount_path); new_volume->mount_path = g_strdup (volume->mount_path);
new_volume->volume_name = g_strdup (volume->volume_name); new_volume->volume_name = g_strdup (volume->volume_name);
new_volume->device = volume->device;
new_volume->is_removable = volume->is_removable; new_volume->is_removable = volume->is_removable;
new_volume->is_audio_cd = volume->is_audio_cd; new_volume->is_audio_cd = volume->is_audio_cd;
...@@ -1563,6 +1672,7 @@ finish_creating_volume (NautilusVolumeMonitor *monitor, NautilusVolume *volume, ...@@ -1563,6 +1672,7 @@ finish_creating_volume (NautilusVolumeMonitor *monitor, NautilusVolume *volume,
{ {
gboolean ok; gboolean ok;
const char *name; const char *name;
struct stat statbuf;
volume->file_system_type = g_hash_table_lookup volume->file_system_type = g_hash_table_lookup
(monitor->details->file_system_table, file_system_type_name); (monitor->details->file_system_table, file_system_type_name);
...@@ -1583,6 +1693,10 @@ finish_creating_volume (NautilusVolumeMonitor *monitor, NautilusVolume *volume, ...@@ -1583,6 +1693,10 @@ finish_creating_volume (NautilusVolumeMonitor *monitor, NautilusVolume *volume,
return FALSE; return FALSE;
} }
if (stat (volume->mount_path, &statbuf) == 0) {
volume->device = statbuf.st_dev;
}
/* Identify device type */ /* Identify device type */
if (eel_str_has_prefix (volume->mount_path, "/mnt/")) { if (eel_str_has_prefix (volume->mount_path, "/mnt/")) {
name = volume->mount_path + strlen ("/mnt/"); name = volume->mount_path + strlen ("/mnt/");
......
...@@ -87,11 +87,14 @@ char * nautilus_volume_monitor_get_mount_name_for_display (Nau ...@@ -87,11 +87,14 @@ char * nautilus_volume_monitor_get_mount_name_for_display (Nau
void nautilus_volume_monitor_set_volume_name (NautilusVolumeMonitor *monitor, void nautilus_volume_monitor_set_volume_name (NautilusVolumeMonitor *monitor,
const NautilusVolume *volume, const NautilusVolume *volume,
const char *volume_name); const char *volume_name);
NautilusVolume *nautilus_volume_monitor_get_volume_for_path (NautilusVolumeMonitor *monitor,
const char *path);
/* Volume operations. */ /* Volume operations. */
char * nautilus_volume_get_name (const NautilusVolume *volume); char * nautilus_volume_get_name (const NautilusVolume *volume);
NautilusDeviceType nautilus_volume_get_device_type (const NautilusVolume *volume); NautilusDeviceType nautilus_volume_get_device_type (const NautilusVolume *volume);
gboolean nautilus_volume_is_removable (const NautilusVolume *volume); gboolean nautilus_volume_is_removable (const NautilusVolume *volume);
gboolean nautilus_volume_is_read_only (const NautilusVolume *volume);
gboolean nautilus_volume_should_integrate_trash (const NautilusVolume *volume); gboolean nautilus_volume_should_integrate_trash (const NautilusVolume *volume);
const char * nautilus_volume_get_mount_path (const NautilusVolume *volume); const char * nautilus_volume_get_mount_path (const NautilusVolume *volume);
char * nautilus_volume_get_target_uri (const NautilusVolume *volume); char * nautilus_volume_get_target_uri (const NautilusVolume *volume);
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#include <gtk/gtkwindow.h> #include <gtk/gtkwindow.h>
#include <libgnome/gnome-i18n.h> #include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-config.h> #include <libgnome/gnome-config.h>
#include <libgnome/gnome-metadata.h>
#include <libgnome/gnome-mime.h> #include <libgnome/gnome-mime.h>
#include <libgnomevfs/gnome-vfs-async-ops.h> #include <libgnomevfs/gnome-vfs-async-ops.h>
#include <libgnomevfs/gnome-vfs-uri.h> #include <libgnomevfs/gnome-vfs-uri.h>
...@@ -283,9 +282,6 @@ get_stored_icon_position_callback (NautilusIconContainer *container, ...@@ -283,9 +282,6 @@ get_stored_icon_position_callback (NautilusIconContainer *container,
char *position_string, *scale_string; char *position_string, *scale_string;
gboolean position_good, scale_good; gboolean position_good, scale_good;
char *locale; char *locale;
char *path, *uri;
int res, size;
char *buf;
g_assert (NAUTILUS_IS_ICON_CONTAINER (container)); g_assert (NAUTILUS_IS_ICON_CONTAINER (container));
g_assert (NAUTILUS_IS_FILE (file)); g_assert (NAUTILUS_IS_FILE (file));
...@@ -310,25 +306,6 @@ get_stored_icon_position_callback (NautilusIconContainer *container, ...@@ -310,25 +306,6 @@ get_stored_icon_position_callback (NautilusIconContainer *container,
/* If it is the desktop directory, maybe the gnome-libs metadata has information about it */ /* If it is the desktop directory, maybe the gnome-libs metadata has information about it */
if (!position_good) {
if (nautilus_file_is_local (file) && nautilus_file_is_in_desktop (file)) {
uri = nautilus_file_get_uri (file);
path = gnome_vfs_get_local_path_from_uri (uri);
if (path != NULL) {
res = gnome_metadata_get (path, "icon-position", &size, &buf);
if (res == 0) {
if (sscanf (buf, "%d%d", &position->x, &position->y) == 2) {
position_good = TRUE;
}
g_free (buf);
}
}
g_free (path);
g_free (uri);
}
}
/* Get the scale of the icon from the metadata. */ /* Get the scale of the icon from the metadata. */
scale_string = nautilus_file_get_metadata scale_string = nautilus_file_get_metadata
(file, NAUTILUS_METADATA_KEY_ICON_SCALE, "1"); (file, NAUTILUS_METADATA_KEY_ICON_SCALE, "1");
...@@ -1850,8 +1827,6 @@ icon_position_changed_callback (NautilusIconContainer *container, ...@@ -1850,8 +1827,6 @@ icon_position_changed_callback (NautilusIconContainer *container,
char *position_string; char *position_string;
char *scale_string, *scale_string_x, *scale_string_y; char *scale_string, *scale_string_x, *scale_string_y;
char *locale; char *locale;
char *uri, *path;
char buf [128];
g_assert (FM_IS_ICON_VIEW (icon_view)); g_assert (FM_IS_ICON_VIEW (icon_view));
g_assert (container == get_icon_container (icon_view)); g_assert (container == get_icon_container (icon_view));
...@@ -1886,19 +1861,6 @@ icon_position_changed_callback (NautilusIconContainer *container, ...@@ -1886,19 +1861,6 @@ icon_position_changed_callback (NautilusIconContainer *container,
(file, NAUTILUS_METADATA_KEY_ICON_POSITION, (file, NAUTILUS_METADATA_KEY_ICON_POSITION,
NULL, position_string); NULL, position_string);
g_free (position_string); g_free (position_string);
if (nautilus_file_is_local (file) && nautilus_file_is_in_desktop (file)) {
uri = nautilus_file_get_uri (file);
path = gnome_vfs_get_local_path_from_uri (uri);
if (path != NULL) {
g_snprintf (buf, sizeof (buf), "%d %d", position->x, position->y);
gnome_metadata_set (path, "icon-position", strlen (buf) + 1, buf);
}
g_free (uri);
g_free (path);
}
} }
/* FIXME bugzilla.eazel.com 662: /* FIXME bugzilla.eazel.com 662:
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <libnautilus-private/nautilus-link.h> #include <libnautilus-private/nautilus-link.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include <gtk/gtklayout.h>
struct NautilusDesktopWindowDetails { struct NautilusDesktopWindowDetails {
GList *unref_list; GList *unref_list;
...@@ -48,8 +49,12 @@ static void nautilus_desktop_window_initialize_class (NautilusDesktopWindowClass ...@@ -48,8 +49,12 @@ static void nautilus_desktop_window_initialize_class (NautilusDesktopWindowClass
static void nautilus_desktop_window_initialize (NautilusDesktopWindow *window); static void nautilus_desktop_window_initialize (NautilusDesktopWindow *window);
static void destroy (GtkObject *object); static void destroy (GtkObject *object);
static void realize (GtkWidget *widget); static void realize (GtkWidget *widget);
static void map (GtkWidget *widget);
static void real_add_current_location_to_history_list (NautilusWindow *window); static void real_add_current_location_to_history_list (NautilusWindow *window);
static void set_wmspec_desktop_hint (GdkWindow *window);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusDesktopWindow, nautilus_desktop_window, NAUTILUS_TYPE_WINDOW) EEL_DEFINE_CLASS_BOILERPLATE (NautilusDesktopWindow, nautilus_desktop_window, NAUTILUS_TYPE_WINDOW)
static void static void
...@@ -57,6 +62,7 @@ nautilus_desktop_window_initialize_class (NautilusDesktopWindowClass *klass) ...@@ -57,6 +62,7 @@ nautilus_desktop_window_initialize_class (NautilusDesktopWindowClass *klass)
{ {
GTK_OBJECT_CLASS (klass)->destroy = destroy; GTK_OBJECT_CLASS (klass)->destroy = destroy;
GTK_WIDGET_CLASS (klass)->realize = realize; GTK_WIDGET_CLASS (klass)->realize = realize;
GTK_WIDGET_CLASS (klass)->map = map;
NAUTILUS_WINDOW_CLASS (klass)->add_current_location_to_history_list NAUTILUS_WINDOW_CLASS (klass)->add_current_location_to_history_list
= real_add_current_location_to_history_list;