Drag and drop optimization

Lubos Lunak kde-optimize@mail.kde.org
Tue, 4 Feb 2003 13:42:04 +0100


On Tuesday 04 of February 2003 13:31, Waldo Bastian wrote:
> On Tuesday 04 February 2003 13:08, Lubos Lunak wrote:
> > One more thing to do could be to have larger
> > 'sameanswer' area (see the XDND spec), but I'm afraid that wouldn't be
> > that trivial in Qt.
>
> For kicker I commited the following:
> -    if (QUriDrag::canDecode(ev))
> -       ev->accept(rect());
> +    if ((ev->source() != this) && QUriDrag::canDecode(ev))
> +        ev->accept(rect());
> +    else
> +        ev->ignore(rect());
>
> Which disables dragging an item onto itself and sets an ignore-area.
>
> The latter should set the 'sameanswer' area, is that what you mean?

 See http://www.newplanetsoftware.com/xdnd/ , section 'Client messages', 
description of 'XdndStatus'. The 'sameanswer' area is a rectangle where it 
doesn't make sense to send additional move events, because ... well, the 
answer from that area will be always the same. Sounds simple, but getting it 
from Qt widgets may not be as easy.

>
> If that helps we might want to scan KDE source for this kind of usage and
> set appropriate acceopt/ignore rects.

 I actually don't find that necessary and worth it. Would you be really that 
happier to see that DND operations take only let's say 10% CPU instead of 
100% for the short amount of time you do the DND operation?

 That of course depends on whether the patches really help on slower machines.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak@suse.cz , l.lunak@kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/