On Fri, 2014-08-29 at 16:58 -0500, richard boaz wrote:
> you can find a discussion and one possible solution of this in a previous
> thread:
> 
> https://mail.gnome.org/archives/gtk-list/2011-July/msg00059.html

I think unfortunately the solution is not that easy...

I have a similar problem with my CAD tool
(http://www.ssalewski.de/PetEd.html.en) -- for fast object movements
moving is not as smooth as it could be. First I thought that simple my
drawing speed is still too slow, but after some optimizations that is
not the problem any more. Indeed it is not a big problem for me, and I
was busy with other tasks, so I have not spent time investigating it.
But I found same reports of other people with similar or related
problems
(http://stackoverflow.com/questions/16359775/gtk-motion-notify-event-is-hint-always-true)

As the author of this question did not provided a minimal test, I just
hacked together this code below. Well it is Ruby, but I would be
surprised if result is much better for plain C. When I move the mouse
pointer fast from left to right, I get the output below, with large gaps
in x coordinate. So I guess that the rate of motion notify events is
indeed low. (I know that there is a POINTER_MOTION_HINT_MASK available,
to suppress too high rates, but that should not help...)
My feeling is, that the maximum event rate is hard coded in GDK library,
I think I read that years ago. Would be not really nice...
 
stefan@AMD64X2 ~ $ ruby test.rb 
4 481
20 481
37 481
57 481
70 481
87 483
104 483
120 483
140 483
160 483
181 483
207 481
226 481

require 'gtk3'

window = Gtk::Window.new
window.set_default_size(800, 800)

window.signal_connect("destroy") {Gtk.main_quit}

window.add_events(Gdk::Event::Mask::POINTER_MOTION_MASK)

window.signal_connect("motion_notify-event") {|w, e|
  print e.x.round, " ", e.y.round, "\n"
}

window.show_all

Gtk.main


> 
> On Fri, Aug 29, 2014 at 4:29 PM, ax487 <ax...@gmx.de> wrote:
> 
> > Hello all,
> >
> > I am wondering about the rate at which pointer motion events are
> > generated. In my application I draw strokes on a canvas. I noticed that
> > if I move the pointer at a high velocity the strokes no longer appear as
> > smooth as for slower pointer motions. The time between motion events (>=
> > 10ms) seems to be inadequate to capture the motion correctly. Is there
> > anyway to increase the time accuracy?


_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to