Is there a way to supress the MotionNotify events generated by
XWarpPointer? If not, is there an alternative to avoid the
MotionNotify events generated from this particular function?
The reason I ask is because I am writing an application that lets the
user drag a circle back and forth along an existing line. If the user
moves the mouse too quickly, the pointer ends up at one of the far
edges of the screen. Therefore, the user has to pick up the mouse
and move it back to the circle to continue dragging it along the line.
As I move the pointer, I want it to stay positioned in the circle.
I think XWarpPointer will solve this problem, but the extra MotionNotify
events from this function are causing problems with drawing/redrawing
Any suggestions would be appreciated.
If you use XWarpPointer, you _will_ get MotionNotify events as long as
they are in your event mask. You could remove MotionNotify from your
event mask during the time you do the warp, then put it back, but that
may have performance implications.
But If I understand correctly: You are dragging a circle, but the user
accidentally leaves the window of your application, perhaps causing you
to lose focus?
Are you grabbing the pointer while the drag is in progress? Generally you
will grab the pointer from the time the button is pressed until it is
released. That way you continue to get MotionNotify events even when the
cursor is outside your window.
e.g. see XGrabPointer()
Not an official HP statement.