Re: slow drags




Rupert Littlewood <rupert@maths.usyd.edu.au> writes:

> Hi all,
> 
> When I try the `dnd' test with testgtk (0.99.4) I'm finding that there
> is quite a lag between the movement of the mouse and the position of
> the dragged icon. (That is, if I move the mouse haphazardly across the
> screen the icon will belatedly trace out the path of the mouse until
> it catches up, rather than keeping pace).  Now, this is on an
> X-terminal, and I vaguely remember (but can't check right now) that the
> performance is much better on my home machine (not networked) but I'm
> reluctant just to blame the Xserver for this, since moving the icons
> using the window manager gives perfectly adequate response.
> 
> This is relevent to the code I'm writing now: a port of a
> half-finished file-manager I was writing in Qt to Gtk--. I'm not using
> Gtk's dnd implementation (I have my own) but I have the same problem:
> dragging icons is very sluggish. The best solution I have so far is to
> ignore the mouse coordinates that GdkEventMotion provides me with and
> get them directly myself. This allows the icon to move exactly where
> it should be, but the delays are propagated, so after the mouse button
> is released a whole bunch of motion_notify's are still queued which
> arrive before the button_release.

You want to be using GDK_POINTER_MOTION_HINT, which says - don't give
me another motion event until I ask for it by getting the pointer
position. (The shaped window demo in testgtk does this, so take
a look at that for example code, but the DND code apparently does not -
it should)

Regards,
                                        Owen



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