summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-02-21 19:15:46 +0200
committerAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-02-22 23:36:22 +0200
commit17314900d88ef08227d14413f96781341796705f (patch)
treeeeb6e329b0b790c261b9bf6ac434370ea1b94544
parentcc755e3efb37d383fecdd0742a36b4dd20d4c725 (diff)
downloadnautilus-17314900d88ef08227d14413f96781341796705f.tar.gz
canvas-container: fix auto_layout desktop crash
When the metadata of the desktop needs to be recalculated or it's missing, we need to reposition the icons. They have what we call a "lazy position". In order to place them on the desktop we either position them by it's saved position if possible, and if not, moving them as close as possible without overlaping, or by what we call "auto layout", which is basically a perfect grid similar to a regular nautilus window. It's clear from this logic that we do either one way to place them or the other, and both at the same time doesn't make sense. For that we assert we just apply one of this placements algorythms. However, we were hitting this assertion if desktop-metadata was missing (so they have a lazy position) since we need to reorder the icons using the auto layout algorthm but the code was also trying to do the "saved position" algorythm. This issue is introduced by a commit intended to avoid overlapping icons, with id: 40c79aec2d2fdc860eadab9b59682ae0b04d5131. In the initial implementation of "lazy position" support, if "auto layout" was chosen, the icons were repositioned only by the "auto layout" algorithm. To fix this re-add the check that repositions icons only by the "auto layout" algorithm if "auto layout" is chosen. https://bugzilla.gnome.org/show_bug.cgi?id=747662
-rw-r--r--src/nautilus-canvas-container.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nautilus-canvas-container.c b/src/nautilus-canvas-container.c
index 7f95ba116..69140c878 100644
--- a/src/nautilus-canvas-container.c
+++ b/src/nautilus-canvas-container.c
@@ -6760,8 +6760,10 @@ finish_adding_new_icons (NautilusCanvasContainer *container)
icon = p->data;
if (icon->has_lazy_position)
{
- assign_icon_position (container, icon);
- semi_position_icons = g_list_prepend (semi_position_icons, icon);
+ if (!assign_icon_position (container, icon))
+ {
+ semi_position_icons = g_list_prepend (semi_position_icons, icon);
+ }
}
else if (!assign_icon_position (container, icon))
{