diff options
author | Gene Z. Ragan <gzr@eazel.com> | 2000-11-15 21:36:42 +0000 |
---|---|---|
committer | Gene Ragan <gzr@src.gnome.org> | 2000-11-15 21:36:42 +0000 |
commit | 259c95fa589d3d267c0937afb55cb395979bacf9 (patch) | |
tree | 860b428bedd190a56692201cf9ab8eb4082e16d0 /libnautilus-private/nautilus-icon-container.c | |
parent | 3c7ded1f7a1de297c798dcfde88d523199b81218 (diff) | |
download | nautilus-259c95fa589d3d267c0937afb55cb395979bacf9.tar.gz |
Fixed bug 4717, Nautilus draw desktop icons overlapping.
2000-11-15 Gene Z. Ragan <gzr@eazel.com>
Fixed bug 4717, Nautilus draw desktop icons overlapping.
The problem was caused by the icon container responding to
an idle function that lays out icons that had been
newly added. This is a problem if the callback is called
form an idle after th eicon container has been created, but
before a size has been allocated. A nely intialized GtkWidget
has a default allocation of 0, 0, 1, 1 which is too small
for the layout algorithm to work properly. A flag was added
that is set to TRUE when the size_allocate function is called.
* src/nautilus-desktop-window.c: (nautilus_desktop_window_new):
Set has_been_allocated to FALSE initially.
* libnautilus-extensions/nautilus-icon-container.c:
(size_allocate), (nautilus_icon_container_initialize),
(nautilus_icon_container_add):
Checj status of has_been_allocated flag before adding
and laying out new icons.
* libnautilus-extensions/nautilus-icon-private.h:
Added has_been_allocated flag that is set to TRUE
when size_allocated is first called.
Work in progress on allowing desktop links to be renamed.
* src/file-manager/fm-desktop-icon-view.c:
(find_and_update_home_link):
Allow renaming of home links.
* src/file-manager/fm-icon-view.c:
(special_link_in_selection):
Removed home link from special link types.
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_can_rename):
Allow renaming of home link types.
Diffstat (limited to 'libnautilus-private/nautilus-icon-container.c')
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index 0f00ea602..187b54427 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -2191,6 +2191,8 @@ static void size_allocate (GtkWidget *widget, GtkAllocation *allocation) { + NAUTILUS_ICON_CONTAINER (widget)->details->has_been_allocated = TRUE; + if (allocation->x != widget->allocation.x || allocation->width != widget->allocation.width || allocation->y != widget->allocation.y || @@ -3148,6 +3150,7 @@ nautilus_icon_container_initialize (NautilusIconContainer *container) container->details->rename_widget = NULL; container->details->original_text = NULL; container->details->type_select_state = NULL; + container->details->has_been_allocated = FALSE; } static gboolean @@ -3694,11 +3697,11 @@ nautilus_icon_container_add (NautilusIconContainer *container, details->new_icons = g_list_prepend (details->new_icons, icon); /* Run an idle function to add the icons. */ - if (container->details->idle_id == 0) { + if (container->details->idle_id == 0 && container->details->has_been_allocated) { container->details->idle_id = gtk_idle_add (finish_adding_new_icons_callback, container); } - + return TRUE; } |