Re: Where to implement motion compression



Karl Nelson wrote:
> 
> > 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 
> 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.)
> 

I don't have may X guide with me.  I will lookup NotifyNormal/NotifyHint
when I get home.  I've looked at Xt implemention of motion compression
and it quickly gobbles up the extra events much faster than they are
produced.

BTW the following files has a check for is_hint followed by
gdk_window_get_pointer:

gtkclist.c
gtkcolorsel.c
gtkdnd.c
gtkentry.c
gtkhpaned.c
gtkhruler.c
gtklist.c
gtknotebook.c
gtkrange.c
gtkspinbutton.c
gtktext.c
gtkvpaned.c
gtkvruler.c
testinput.c



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