Hi,

I'm working on a brush tool for a paint program and have a question about 
mouse event granularity. The problem is I need to get the coordinates of all, 
(or as many as possible), pixels covered by the mouse pointer by a mouse move 
when the tool is selected. By default if you move the mouse from one part of 
the widget to another it only sends a few MotionNotify (XMotionEvent) events 
while the cursor is in motion, not events for every pixel covered.

In addition to a MotionNotify handler I also tried XGetMotionEvents and doing 
a custom grab first, none of which worked.

Is it possible to get finer granularity with events? Looking at the Gimp's 
brush it certainly appears as though it is getting events for every 
coordinate and queuing it - if you move the mouse back and forth really fast 
it seems to get the actual pixel coordinates - not draw lines between points. 
Looking in the source I can see it sets an "Exact" motion mode for it's 
canvas but I can't tell what this resolves to, (I'm obviously not a GTK/GDK 
developer ;-).

I guess one can constantly poll the position when needed, but this would suck 
because you can miss pixels while doing the processing for the tool. It would 
be much better to be able to get either finer granularity from events or a 
more precise motion history. Anyone know how to do this?
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to