From: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Simplification to mouse-avoidance-mode (patch) + redisplay bug?
Date: Fri, 12 May 2006 09:07:46 +0200 [thread overview]
Message-ID: <44643442.1020004@swipnet.se> (raw)
In-Reply-To: <m3fyjgnajg.fsf@kfs-l.imdomain.dk>
>> 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 <storm@cua.dk> http://www.cua.dk
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2006-05-12 7:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-02 12:23 Simplification to mouse-avoidance-mode (patch) + redisplay bug? Kim F. Storm
2006-05-02 21:37 ` Richard Stallman
2006-05-10 14:01 ` Kim F. Storm
2006-05-11 3:46 ` Richard Stallman
2006-05-11 7:50 ` Jan Djärv
2006-05-11 10:03 ` Kim F. Storm
2006-05-12 7:07 ` Jan Djärv [this message]
2006-05-14 0:12 ` Kim F. Storm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44643442.1020004@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.