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).

I currently have implemented it in gtk_main_do_event and have added a
GtkWidgetFlag called GTK_COMPRESS_MOTION.  This seems like the correct
place to add it because it is a property of the widget.

It could be implemented more efficiently in gdk_event_translate and make it
a property of the window.  I would add GDK_POINTER_MOTION_COMPRESS_MASK to
GdkEventMask but that does not make since because it is not an event.
There's the problem.

My gut feeling is to leave it in gtk_main_do_event.  What do you think?
-- 
    ____    /----------------------------------\    .    _  .
   /  /_\_  | Robert "Killer Kadoogen" Minsk   |    |\_|/__/|
  |  |/o\o\ | egbert@centropolisfx.com         |   / / \/ \  \
  |  \\_/_/ |                                  |  /__|O||O|__ \
 / |_   |   | Centropolis Effects              | |/_ \_/\_/ _\ |
|  ||\_ ~|  | 10950 Washington Blvd., Studio B | | | (____) | ||
|  ||| \/   | Culver City, Ca. 90232-4025      | \/\___/\__/ //
|  |||      \----------------------------------/ (_/         ||
 \// \                                            |          ||
  ||  \                                           |          ||
  ||_  \                                          |          ||\
  \_|  o|                                          \        //_/
  /\___/                                            \______//
 /  ||||__                                        __ || __||
    (___)_)                                      (____(____)



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