Drag and drop optimization

Lubos Lunak kde-optimize@mail.kde.org
Wed, 5 Feb 2003 13:27:27 +0100


On Tuesday 04 of February 2003 22:36, Wilco Greven wrote:
> On Tuesday 04 February 2003 13:08, Lubos Lunak wrote:
[snip]
> I tried out your patch. At first it didn't seem to be any better than the
> old situation. I could be that the first part (the hole patch), doesn't
> work as expected. Maybe Enter/Leave events are to blame in this case.
>

 I actually left some of the debug comments in the patch. The 'AVOIDING' 
message lists number of avoided calls to QDragManager::move(). The 'TAR:' 
message lists results of finding the window under the cursor, and with the 
hole in the pixmap, the third number should never be the same as one of the 
first two (and it's not here). Can you check that?

> Then I combined the motion event compression with my own patch. Now the
> effect of the event compressing made a big difference. The drag shapes
> followed the mouse cursor much better.
>
> >  In general, I don't think there can be done much more. This is a tough
> > problem, actually. 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.
>
> But deciding how big the answer rectangle is is up to the target. If the
> target wants to track the mouse (for showing dragshapes for example), the
> source has to keep sending position messages.

 Yes. Dragging in Konqy in iconview mode is an example of this. So the 
sameaswer area is even less useful.

>
> Maybe the drag shapes shouldn't be shown. They are pretty useless IMO. And
> there are other ways for the target to indicate that it accepts the drag.

 Hmms.

>
> > I tried also some other things, like updating the icon position only
> > every X ms, but that didn't look nice. And, actually, if the discarding
> > of superfluous move events will help to make it visuall acceptable
> > without the icon lagging behind the cursor, I think there no need for
> > further optimizations.
>
> Some other improvements are needed to make dnd really usable on my
> computer. It happens pretty often that I drop something, before the target
> has had the time to check whether it accepts the drag. The result is that
> the drag doesn't work.

 What's your HW configuration exactly? But if it happens exactly as you 
describe above, then either the spec has a flaw or the Qt implementation is 
flawed.

-- 
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/