[Top][All Lists]

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

Re: Simplification to mouse-avoidance-mode (patch) + redisplay bug?

From: Jan Djärv
Subject: Re: Simplification to mouse-avoidance-mode (patch) + redisplay bug?
Date: Thu, 11 May 2006 09:50:47 +0200
User-agent: Thunderbird (X11/20060501)

Kim F. Storm skrev:

I've debugged this far -- and need an X-pert (Jan?) to take over:

mouse-avoidance-mode 'animate uses set-mouse-position to move
the mouse cursor in ~10 steps to reach its end position.

If I type very slowly, approaching the window cursor to the mouse
cursor -- and don't type anything while the mouse cursor is moving,
everything works, i.e. the mouse cursor shape at the final destination
is ok.

If I type more quickly, the mouse cursor still moves in steps, but
it may end up with any of the cursor shapes it had along the path.

I put some trace output into xterm.c, and it seems that (in the first
case) for each call to x_set_mouse_position (which calls
XWarpPointer), the event loop receives a MotionNotify event
(event.type = 6) with the new mouse cursor position.

.. unless I hit a key while the mouse is moving (the second case).

As soon as emacs gets the key event (event.type = 2), no further
MotionNotify events are delivered for the remaining mouse positions
along the path.

This looks like an X bug.  This is the Xfree server from redhat 9.0.

Are you sure x_set_mouse_position is called? When I hold down a key and let it repeat, mouse avoidance is not working at all (i.e. x_set_mouse_position is not called). I suspect event processing takes all time so mouse avoidance does not get time to check where the cursor is.

Another thing is that X is not guaranteed to deliver MotionNotify for every pixel the mouse moves through. It is actually undefined how many MotionNotify you will get when moiving the mouse, but you are guaranteed to get one MotionNotify when the mouse movement stops.

A third thing to check is if the XWarpPointer requests are queued or not. You can add a call to XFlush after XWarpPointer and see if that improves the situation.

I tried, but could not reproduce the situation where the cursor shape is wrong. I'm sure it is timing related, i.e. events not sent or received when expected to.

        Jan D.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]