From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?SmFuIERqw6Rydg==?= Newsgroups: gmane.emacs.devel Subject: Re: Simplification to mouse-avoidance-mode (patch) + redisplay bug? Date: Fri, 12 May 2006 09:07:46 +0200 Message-ID: <44643442.1020004@swipnet.se> References: <4462ECD7.7020106@swipnet.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1147417728 6577 80.91.229.2 (12 May 2006 07:08:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 May 2006 07:08:48 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 12 09:08: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 1FeRlU-0004W9-JB for ged-emacs-devel@m.gmane.org; Fri, 12 May 2006 09:08:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FeRlT-00020j-QT for ged-emacs-devel@m.gmane.org; Fri, 12 May 2006 03:08:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FeRlH-0001zu-OZ for emacs-devel@gnu.org; Fri, 12 May 2006 03:08:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FeRlF-0001y5-N5 for emacs-devel@gnu.org; Fri, 12 May 2006 03:08:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FeRlF-0001xx-8s for emacs-devel@gnu.org; Fri, 12 May 2006 03:08:29 -0400 Original-Received: from [81.228.9.182] (helo=av7-2-sn3.vrr.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FeRmm-0002K8-6H; Fri, 12 May 2006 03:10:05 -0400 Original-Received: by av7-2-sn3.vrr.skanova.net (Postfix, from userid 502) id 96E7837F99; Fri, 12 May 2006 08:44:52 +0200 (CEST) Original-Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av7-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 8889537E68; Fri, 12 May 2006 08:44:52 +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 9CF1237E45; Fri, 12 May 2006 09:08:17 +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:54303 Archived-At: >> 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. > > The problem is that the MotionNotify event that you get is not the > final mouse position. Then there is abug somewhere. It could be in X but it could also be in Emacs event handling, i.e. we are not reading events even if they are in the X input queue. > >> 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. > > It actually makes the situation worse -- now the final mouse shape > is wrong also when I type slowly, i.e. when I don't hit a key after > the mouse cursor starts moving. I hope you added x_flush, not XFlush. I see now that XFlush is defined to be empty in xterm.c. If an XSync after WarpPointer doesn't get you all events then there is a bug in X. > >> 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. > > So, it is probably a bug in the (old) version of Xfree that I'm using, > and it looks like the bug is fixed in later versions. Are you running with SYNC_INPUT or not? > > > I tried to add an explicit call to note_mouse_highlight after the > call to XWarpPointer, and it definitely has a positive effect, > but even with that change, the pointer shape ends up wrong in > some cases. > > I'm not sure how important it is to fix this, but there is > a patch which works for me -- of course a similar change > is probably needed in x_set_mouse_pixel_position. > This patch has flaws, there may be several calls to XWarpPointer before we see any MotionNotify events. Jan D. > *** xterm.c 10 May 2006 16:58:38 +0200 1.910 > --- xterm.c 11 May 2006 11:52:27 +0200 > *************** > *** 226,231 **** > --- 226,233 ---- > > static unsigned long ignore_next_mouse_click_timeout; > > + static int ignore_next_motion_event; > + > /* Mouse movement. > > Formerly, we used PointerMotionHintMask (in standard_event_mask) > *************** > *** 6543,6548 **** > --- 6545,6556 ---- > > case MotionNotify: > { > + if (ignore_next_motion_event) > + { > + ignore_next_motion_event = 0; > + goto OTHER; > + } > + > previous_help_echo_string = help_echo_string; > help_echo_string = Qnil; > > *************** > *** 8453,8458 **** > --- 8461,8471 ---- > > XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), > 0, 0, 0, 0, pix_x, pix_y); > + > + last_mouse_motion_event.x = pix_x; > + last_mouse_motion_event.y = pix_y; > + note_mouse_movement (f, &last_mouse_motion_event); > + ignore_next_motion_event = 1; > UNBLOCK_INPUT; > } > > *************** > *** 10795,10800 **** > --- 10808,10814 ---- > last_tool_bar_item = -1; > any_help_event_p = 0; > ignore_next_mouse_click_timeout = 0; > + ignore_next_motion_event = 0; > #ifdef HAVE_X_SM > x_session_initialized = 0; > #endif > > -- > Kim F. Storm http://www.cua.dk > > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel