Commit 569f5dbf authored by Alexandru Pandelea's avatar Alexandru Pandelea

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: 40c79aec. 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.
parent f6e557ac
......@@ -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))
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