From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Simplification to mouse-avoidance-mode (patch) + redisplay bug? Date: Thu, 11 May 2006 09:50:47 +0200 Message-ID: <4462ECD7.7020106@swipnet.se> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1147333907 18963 80.91.229.2 (11 May 2006 07:51:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 May 2006 07:51:47 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 11 09:51:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fe5xR-0007Me-Jt for ged-emacs-devel@m.gmane.org; Thu, 11 May 2006 09:51:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fe5xQ-0003yZ-Tf for ged-emacs-devel@m.gmane.org; Thu, 11 May 2006 03:51:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fe5x0-0003yI-Gn for emacs-devel@gnu.org; Thu, 11 May 2006 03:51:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fe5wy-0003xs-PM for emacs-devel@gnu.org; Thu, 11 May 2006 03:51:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fe5wy-0003xp-Ja for emacs-devel@gnu.org; Thu, 11 May 2006 03:51:08 -0400 Original-Received: from [81.228.9.181] (helo=av7-1-sn3.vrr.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fe5yP-0000Ac-9v; Thu, 11 May 2006 03:52:37 -0400 Original-Received: by av7-1-sn3.vrr.skanova.net (Postfix, from userid 502) id A635C37EE4; Thu, 11 May 2006 09:27:44 +0200 (CEST) Original-Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av7-1-sn3.vrr.skanova.net (Postfix) with ESMTP id 9761237EE1; Thu, 11 May 2006 09:27:44 +0200 (CEST) Original-Received: from coolsville.localdomain (81-235-205-204-no59.tbcn.telia.com [81.235.205.204]) by smtp3-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 1DCCA37E46; Thu, 11 May 2006 09:51:05 +0200 (CEST) User-Agent: Thunderbird 1.5.0.2 (X11/20060501) Original-To: "Kim F. Storm" In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:54248 Archived-At: 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.