diff options
| author | Po Lu | 2025-03-10 12:41:12 +0800 |
|---|---|---|
| committer | Po Lu | 2025-03-10 12:41:12 +0800 |
| commit | ab5bfcebddf4c0613ef352231628d4034c8cb178 (patch) | |
| tree | 57c39711dfb31dcd4c24d711afb1e1d8099b8033 | |
| parent | d343a80e6e1854ffdbea1378f0bc4f836fd01ea4 (diff) | |
| download | emacs-ab5bfcebddf4c0613ef352231628d4034c8cb178.tar.gz emacs-ab5bfcebddf4c0613ef352231628d4034c8cb178.zip | |
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)
| -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, | |||
| 14878 | return; | 14878 | return; |
| 14879 | } | 14879 | } |
| 14880 | 14880 | ||
| 14881 | FOR_EACH_FRAME (tail, frame) | ||
| 14882 | { | ||
| 14883 | if (FRAME_X_P (XFRAME (frame)) | ||
| 14884 | && (FRAME_DISPLAY_INFO (XFRAME (frame)) | ||
| 14885 | == dpyinfo)) | ||
| 14886 | XFRAME (frame)->mouse_moved = false; | ||
| 14887 | } | ||
| 14888 | |||
| 14881 | if (!EQ (Vx_use_fast_mouse_position, Qreally_fast)) | 14889 | if (!EQ (Vx_use_fast_mouse_position, Qreally_fast)) |
| 14882 | { | 14890 | { |
| 14883 | /* This means that Emacs should select a frame and report the | 14891 | /* 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, | |||
| 14886 | window beneath the pointer, and was borrowed from | 14894 | window beneath the pointer, and was borrowed from |
| 14887 | haiku_mouse_position in haikuterm.c. */ | 14895 | haiku_mouse_position in haikuterm.c. */ |
| 14888 | 14896 | ||
| 14889 | FOR_EACH_FRAME (tail, frame) | ||
| 14890 | { | ||
| 14891 | if (FRAME_X_P (XFRAME (frame)) | ||
| 14892 | && (FRAME_DISPLAY_INFO (XFRAME (frame)) | ||
| 14893 | == dpyinfo)) | ||
| 14894 | XFRAME (frame)->mouse_moved = false; | ||
| 14895 | } | ||
| 14896 | |||
| 14897 | if (gui_mouse_grabbed (dpyinfo) | 14897 | if (gui_mouse_grabbed (dpyinfo) |
| 14898 | && !EQ (track_mouse, Qdropping) | 14898 | && !EQ (track_mouse, Qdropping) |
| 14899 | && !EQ (track_mouse, Qdrag_source)) | 14899 | && !EQ (track_mouse, Qdrag_source)) |
| @@ -14952,8 +14952,8 @@ x_fast_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, | |||
| 14952 | } | 14952 | } |
| 14953 | else | 14953 | else |
| 14954 | { | 14954 | { |
| 14955 | /* This means Emacs should only report the coordinates of the | 14955 | /* This means Emacs should only report the coordinates of the last |
| 14956 | last mouse motion. */ | 14956 | mouse motion. */ |
| 14957 | 14957 | ||
| 14958 | if (dpyinfo->last_mouse_motion_frame) | 14958 | if (dpyinfo->last_mouse_motion_frame) |
| 14959 | { | 14959 | { |
| @@ -14963,15 +14963,6 @@ x_fast_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, | |||
| 14963 | *y = make_fixnum (dpyinfo->last_mouse_motion_y); | 14963 | *y = make_fixnum (dpyinfo->last_mouse_motion_y); |
| 14964 | *bar_window = Qnil; | 14964 | *bar_window = Qnil; |
| 14965 | *part = scroll_bar_nowhere; | 14965 | *part = scroll_bar_nowhere; |
| 14966 | |||
| 14967 | FOR_EACH_FRAME (tail, frame) | ||
| 14968 | { | ||
| 14969 | if (FRAME_X_P (XFRAME (frame)) | ||
| 14970 | && (FRAME_DISPLAY_INFO (XFRAME (frame)) | ||
| 14971 | == dpyinfo)) | ||
| 14972 | XFRAME (frame)->mouse_moved = false; | ||
| 14973 | } | ||
| 14974 | |||
| 14975 | dpyinfo->last_mouse_motion_frame->mouse_moved = false; | 14966 | dpyinfo->last_mouse_motion_frame->mouse_moved = false; |
| 14976 | } | 14967 | } |
| 14977 | } | 14968 | } |