diff options
| author | Po Lu <luangruo@yahoo.com> | 2025-03-10 12:41:12 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2025-03-10 12:41:12 +0800 |
| commit | ab5bfcebddf4c0613ef352231628d4034c8cb178 (patch) | |
| tree | 57c39711dfb31dcd4c24d711afb1e1d8099b8033 /src/xterm.c | |
| parent | d343a80e6e1854ffdbea1378f0bc4f836fd01ea4 (diff) | |
Fix bug#76805
* src/xterm.c (x_fast_mouse_position): Clear the mouse_moved
flag whether or not mouse motion is reported, to avoid repeated
polling for mouse movement. (bug#76806)
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/xterm.c b/src/xterm.c index 2ccf267bbd3..b21efd5a2a2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14878,6 +14878,14 @@ x_fast_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, return; } + FOR_EACH_FRAME (tail, frame) + { + if (FRAME_X_P (XFRAME (frame)) + && (FRAME_DISPLAY_INFO (XFRAME (frame)) + == dpyinfo)) + XFRAME (frame)->mouse_moved = false; + } + if (!EQ (Vx_use_fast_mouse_position, Qreally_fast)) { /* This means that Emacs should select a frame and report the @@ -14886,14 +14894,6 @@ x_fast_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, window beneath the pointer, and was borrowed from haiku_mouse_position in haikuterm.c. */ - FOR_EACH_FRAME (tail, frame) - { - if (FRAME_X_P (XFRAME (frame)) - && (FRAME_DISPLAY_INFO (XFRAME (frame)) - == dpyinfo)) - XFRAME (frame)->mouse_moved = false; - } - if (gui_mouse_grabbed (dpyinfo) && !EQ (track_mouse, Qdropping) && !EQ (track_mouse, Qdrag_source)) @@ -14952,8 +14952,8 @@ x_fast_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, } else { - /* This means Emacs should only report the coordinates of the - last mouse motion. */ + /* This means Emacs should only report the coordinates of the last + mouse motion. */ if (dpyinfo->last_mouse_motion_frame) { @@ -14963,15 +14963,6 @@ x_fast_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, *y = make_fixnum (dpyinfo->last_mouse_motion_y); *bar_window = Qnil; *part = scroll_bar_nowhere; - - FOR_EACH_FRAME (tail, frame) - { - if (FRAME_X_P (XFRAME (frame)) - && (FRAME_DISPLAY_INFO (XFRAME (frame)) - == dpyinfo)) - XFRAME (frame)->mouse_moved = false; - } - dpyinfo->last_mouse_motion_frame->mouse_moved = false; } } |
