Re: Where to implement motion compression



> I currently adding motion compression to the event loop in gtk+ and wanted
> some feedback as to what library (gdk or gtk) to implement it.  Motion
> compression filter throws out all but the last motion notify (the most
> recent position).  This is useful for widgets that need the most up-to-date
> position but do not need the full history of pointer positions.  Unlike the
> current MOTION_HINT_MASK this would be done in the event loop avoiding the
> round trip to the X server with gdk_window_get_pointer.  Also events are
> delivered in order (see discussion on gtk-list).

Why must there be a round trip to the server with the gdk_window_get_pointer?
Isn't the cursor position already somewhere in the Event structure?
If it is then it is just bad coding on the examples that they are 
calling the get_pointer as the info was already available.  (Looking
at my X programmers guide it looks like this is already true.)

Thus I don't think the motion compression is really necessary.  Besides
how do you plan to compress them?  If you are not going to set MOTION_HINT_MASK
and handle the compression on the gdk side of the pipe then the
time spend processing all the pent up events would eat far more
time than the trip for the get_pointer.

Just some things to consider.

--Karl






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