Re: [PATCH] Don't position volume/drives above other icons



On Wed, 2005-09-07 at 11:57 +0200, Christian Neumair wrote:
> Am Dienstag, den 23.08.2005, 13:56 +0200 schrieb Christian Neumair:
> > Am Dienstag, den 23.08.2005, 12:49 +0200 schrieb Christian Neumair:
> > > Am Dienstag, den 23.08.2005, 12:41 +0200 schrieb martin wehner:
> > > > On 8/23/05, Christian Neumair <chris gnome-de org> wrote:
> > > > > Am Dienstag, den 23.08.2005, 01:44 +0200 schrieb Martin Wehner:
> > > > > > On Mon, 2005-08-15 at 00:52 +0200, Christian Neumair wrote:
> > > > > > > Probably the most obvious/reported icon container glitch [1,2].
> > > > > > > Proposed patch attached.
> > > > > >
> > > > > > While it'd be cool to fix at last, this code doesn't handle multiple
> > > > > > lazy icons properly. You can make multiple devices appear on top of each
> > > > > > other, because lazy icons won't be taken into account once they aren't
> > > > > > new anymore.
> > > > > 
> > > > > Of course. We do call placement_grid_mark_icon which will take care that
> > > > > other semi-positioned icons aren't assigned the same grid position.
> > > > 
> > > > Yes, but only for the _new_ icons, the previous lazy icons aren't
> > > > pre-filled into the grid you use to find a free position. Just put two
> > > > devices at the same position on your desktop and try it. I did.
> > > 
> > > We could also mark icons as not being lazy once they're positioned. This
> > > would probably be the most straightforward and obvious solution, since
> > > otherwise we'd have to add a g_list_find foreach 
> > > 
> > > if (icon_is_positioned (icon) && !icon->has_lazy_position) {
> > > 
> > > which could be quiet expensive.
> > 
> > Even if it is not expensive (which is very often the case, since
> > semi_position_icons isn't very long typically), it just seems to be
> > wrong to keep around a special has_lazy_position flag which is
> > essentially ignored after the first layout.
> > Therefore, setting it to FALSE after positioning the icon seems to be
> > way more reasonable.
> > 
> > Proposed patch attached. A quick test with two volumes revealed that it
> > seems to work correctly.
> 
> I wonder whether this is appropriate for 2.12.1. I think this is a
> bugfix rather than a new feature.

We should use lazy positioning for all files that are
NAUTILUS_IS_DESKTOP_ICON_FILE(file), not only volumes/drives. I commited
the patch with this change.

However, the bug isn't totally fixed even with this. For instance, if on
startup a volume is mounted, and its stored position conflicts with a
positioned normal file, then it won't be moved. What happens in this
case is that the volume gets added first to the icon container (all
desktop icons do, since no i/o is necessary for them. Another way this
could happen is when a normal file gets "resurrected" (touch foo; rm
foo; put volume where foo was; touch foo). This case is essentially what
happens in the startup case, and its not all that easy to fix.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an ungodly zombie matador with no name. She's an elegant foul-mouthed 
pearl diver operating on the wrong side of the law. They fight crime! 




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