Re: [gtk-list] RE: Eating surplus events?




On Wed, 3 Jun 1998, Jonathan Belson wrote:
> 
> Is there any way I can prevent my app from being 'swamped' with
> motion_notify events when the user moves the mouse rapidly? 
> 

It's in the tutorial, the Scribble example at the end.

   It turns out, however, that there is a problem with just specifying
   GDK_POINTER_MOTION_MASK. This will cause the server to add a new
   motion event to the event queue every time the user moves the mouse.
   Imagine that it takes us 0.1 seconds to handle a motion event, but the
   X server queues a new motion event every 0.05 seconds. We will soon
   get way behind the users drawing. If the user draws for 5 seconds, it
   will take us another 5 seconds to catch up after they release the
   mouse button! What we would like is to only get one motion event for
   each event we process. The way to do this is to specify
   GDK_POINTER_MOTION_HINT_MASK.

See the tutorial for details.

Havoc Pennington ==== http://pobox.com/~hp



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