diff options
| author | Po Lu | 2025-03-18 09:41:56 +0800 |
|---|---|---|
| committer | Po Lu | 2025-03-18 09:41:56 +0800 |
| commit | 5a4b9ca7364f225eff9b134ff06a49c46179366e (patch) | |
| tree | db89e7d26068678affbdf8e775a0c9b31ba05980 /src | |
| parent | 5f4c9053538fc1bf472c1be9a203db5c6178ea02 (diff) | |
| download | emacs-5a4b9ca7364f225eff9b134ff06a49c46179366e.tar.gz emacs-5a4b9ca7364f225eff9b134ff06a49c46179366e.zip | |
Fix generation of mouse position lists on the tool and tab bars
* src/keyboard.c (make_lispy_tty_position): Return whether an
internal border was hit.
(make_lispy_position): Only skip standard window and frame
detection process if so, as there are other scenarios where POSN
is nil but WINDOW_OR_FRAME is none the less expected to be
provided by the conditionals skipped.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index f3a8d8bab77..5db11ad6379 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5616,9 +5616,12 @@ enum frame_border_side | |||
| 5616 | is any frame but WINDOW_OR_FRAME and R whose root is R, which is not | 5616 | is any frame but WINDOW_OR_FRAME and R whose root is R, which is not |
| 5617 | decorated and has a 'drag-internal-border' parameter. If we find a | 5617 | decorated and has a 'drag-internal-border' parameter. If we find a |
| 5618 | suitable frame, set WINDOW_OR_FRAME to it and POSN to the part of the | 5618 | suitable frame, set WINDOW_OR_FRAME to it and POSN to the part of the |
| 5619 | internal border corresponding to (MX, MY) on the frame found. */ | 5619 | internal border corresponding to (MX, MY) on the frame found. |
| 5620 | 5620 | ||
| 5621 | static void | 5621 | Value is 1 if MX and MY rest in one of R or its children's |
| 5622 | decorations, and 0 otherwise. */ | ||
| 5623 | |||
| 5624 | static int | ||
| 5622 | make_lispy_tty_position (struct frame *r, int mx, int my, | 5625 | make_lispy_tty_position (struct frame *r, int mx, int my, |
| 5623 | Lisp_Object *window_or_frame, Lisp_Object *posn) | 5626 | Lisp_Object *window_or_frame, Lisp_Object *posn) |
| 5624 | { | 5627 | { |
| @@ -5678,7 +5681,10 @@ make_lispy_tty_position (struct frame *r, int mx, int my, | |||
| 5678 | 5681 | ||
| 5679 | XSETFRAME (*window_or_frame, f); | 5682 | XSETFRAME (*window_or_frame, f); |
| 5680 | *posn = builtin_lisp_symbol (internal_border_parts[part]); | 5683 | *posn = builtin_lisp_symbol (internal_border_parts[part]); |
| 5684 | return 1; | ||
| 5681 | } | 5685 | } |
| 5686 | |||
| 5687 | return 0; | ||
| 5682 | } | 5688 | } |
| 5683 | 5689 | ||
| 5684 | /* X and Y are frame-relative coordinates for a click or wheel event. | 5690 | /* X and Y are frame-relative coordinates for a click or wheel event. |
| @@ -5761,10 +5767,9 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5761 | 5767 | ||
| 5762 | if (WINDOWP (window_or_frame) && is_tty_frame (f) | 5768 | if (WINDOWP (window_or_frame) && is_tty_frame (f) |
| 5763 | && (is_tty_root_frame_with_visible_child (f) | 5769 | && (is_tty_root_frame_with_visible_child (f) |
| 5764 | || is_tty_child_frame (f))) | 5770 | || is_tty_child_frame (f)) |
| 5765 | make_lispy_tty_position (root_frame (f), mx, my, &window_or_frame, &posn); | 5771 | && make_lispy_tty_position (root_frame (f), mx, my, |
| 5766 | 5772 | &window_or_frame, &posn)) | |
| 5767 | if (!NILP (posn)) | ||
| 5768 | ; | 5773 | ; |
| 5769 | else if (WINDOWP (window_or_frame)) | 5774 | else if (WINDOWP (window_or_frame)) |
| 5770 | { | 5775 | { |