Re: [PATCH] Don't set lazy icon position during directory load

On Sat, 2006-03-25 at 21:53 +0100, Christian Neumair wrote:
> The attached patch prevents Nautilus from setting lazy icon positions
> during directory load. The original code was invented to make the icon
> of volumes that were mounted by the logged in user not overlap with
> existing items. However that had the side-effect that during directory
> (re)load the icons are placed according to the placement grid which
> doesn't neccessarily match the base column width on the desktop.

I have a related patch here:

> After all the pain I had with this issue, the actual solution was found
> in a tavern. Hail to the beer :).

My patch has the problem that if you mount a volume (i.e. insert a CD),
AND there was an old position stored for the icon, AND there is an icon
in that old position already, then the new icon will appear not in its
original position (good), but overlapped with some other icons (bad).
This is, as you have said, because the placement grids are different.

One thing that puzzled me is this.  I replaced the PlacementGrid code
with something simple that just used GdkRegions, and actually performed
exact intersections on the regions covered by icons.  I still got
overlaps.  My region code was based on the bounding boxes of icons, so I
started digging into the bounds-calculation code in
nautilus-icon-canvas-item.  It's *way* too baroque... made me give up :)

In the end, what we want is this:

1. Got a new icon?  Put it where it doesn't overlap.

2. No hysteresis when toggling "keep aligned"

3. No repositioning on reload.

4. The screen shrunk since the last time you used the desktop (i.e.
switch to a lower resolution)?  There are two options:  scale *all* icon
positions proportionally, risking overlaps but more or less retaining
the "shape" of the original positions; or just clip the old coordinates
so that the icons fit in the screen.

Sounds like we need an automated test for all this.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]