diff options
| author | Jared Finder | 2025-02-22 14:25:37 -0800 |
|---|---|---|
| committer | Juri Linkov | 2025-04-15 21:52:47 +0300 |
| commit | 8528249ee29b243772de48c7c44d07744adb3afc (patch) | |
| tree | d14e024d3a2034f8cb01a212fbb4ab5059054960 /src | |
| parent | f67e64028efd2d2b12126039ffd830e769015910 (diff) | |
| download | emacs-8528249ee29b243772de48c7c44d07744adb3afc.tar.gz emacs-8528249ee29b243772de48c7c44d07744adb3afc.zip | |
Show drag cursor on all window lines (mode, tab, header)
* lisp/ruler-mode.el (ruler-mode-map): Remove down-mouse-1
binding that conflicts with dragging header line.
* src/xdisp.c (note_mode_line_or_margin_highlight): Renamed
to...
(note_line_or_margin_highlight): ...new name since it applies to
any window line (mode, tab, header). Set drag cursor for window
top lines.
(note_mouse_highlight): Update call to new name (bug#76084).
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index dedd4bcaeea..a26626dd61e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -35873,15 +35873,15 @@ define_frame_cursor1 (struct frame *f, Emacs_Cursor cursor, Lisp_Object pointer) | |||
| 35873 | #endif | 35873 | #endif |
| 35874 | } | 35874 | } |
| 35875 | 35875 | ||
| 35876 | /* Take proper action when mouse has moved to the mode or header line | 35876 | /* Take proper action when mouse has moved to one of the window's lines |
| 35877 | or marginal area AREA of window W, x-position X and y-position Y. | 35877 | (mode, tab, or header) or marginal area AREA of window W, x-position |
| 35878 | X is relative to the start of the text display area of W, so the | 35878 | X and y-position Y. X is relative to the start of the text display |
| 35879 | width of bitmap areas and scroll bars must be subtracted to get a | 35879 | area of W, so the width of bitmap areas and scroll bars must be |
| 35880 | position relative to the start of the mode line. */ | 35880 | subtracted to get a position relative to the start of a line. */ |
| 35881 | 35881 | ||
| 35882 | static void | 35882 | static void |
| 35883 | note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | 35883 | note_line_or_margin_highlight (Lisp_Object window, int x, int y, |
| 35884 | enum window_part area) | 35884 | enum window_part area) |
| 35885 | { | 35885 | { |
| 35886 | struct window *w = XWINDOW (window); | 35886 | struct window *w = XWINDOW (window); |
| 35887 | struct frame *f = XFRAME (w->frame); | 35887 | struct frame *f = XFRAME (w->frame); |
| @@ -36017,9 +36017,13 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 36017 | /* Change the mouse pointer according to what is under it. */ | 36017 | /* Change the mouse pointer according to what is under it. */ |
| 36018 | if (FRAME_WINDOW_P (f)) | 36018 | if (FRAME_WINDOW_P (f)) |
| 36019 | { | 36019 | { |
| 36020 | bool draggable = (! WINDOW_BOTTOMMOST_P (w) | 36020 | bool draggable_window_bottom_line = |
| 36021 | || minibuf_level | 36021 | (area == ON_MODE_LINE && (! WINDOW_BOTTOMMOST_P (w) |
| 36022 | || NILP (Vresize_mini_windows)); | 36022 | || minibuf_level |
| 36023 | || NILP (Vresize_mini_windows))); | ||
| 36024 | bool draggable_window_top_line = | ||
| 36025 | ((area == ON_HEADER_LINE || area == ON_TAB_LINE) | ||
| 36026 | && ! WINDOW_TOPMOST_P (w)); | ||
| 36023 | 36027 | ||
| 36024 | if (STRINGP (string)) | 36028 | if (STRINGP (string)) |
| 36025 | { | 36029 | { |
| @@ -36038,11 +36042,12 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 36038 | map = Fget_text_property (pos, Qlocal_map, string); | 36042 | map = Fget_text_property (pos, Qlocal_map, string); |
| 36039 | if (!KEYMAPP (map)) | 36043 | if (!KEYMAPP (map)) |
| 36040 | map = Fget_text_property (pos, Qkeymap, string); | 36044 | map = Fget_text_property (pos, Qkeymap, string); |
| 36041 | if (!KEYMAPP (map) && draggable && area == ON_MODE_LINE) | 36045 | if (!KEYMAPP (map) && (draggable_window_top_line |
| 36046 | || draggable_window_bottom_line)) | ||
| 36042 | cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor; | 36047 | cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor; |
| 36043 | } | 36048 | } |
| 36044 | } | 36049 | } |
| 36045 | else if (draggable && area == ON_MODE_LINE) | 36050 | else if (draggable_window_top_line || draggable_window_bottom_line) |
| 36046 | cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor; | 36051 | cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor; |
| 36047 | else if ((area == ON_MODE_LINE | 36052 | else if ((area == ON_MODE_LINE |
| 36048 | && WINDOW_BOTTOMMOST_P (w) | 36053 | && WINDOW_BOTTOMMOST_P (w) |
| @@ -36474,11 +36479,11 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 36474 | } | 36479 | } |
| 36475 | #endif | 36480 | #endif |
| 36476 | 36481 | ||
| 36477 | /* Mouse is on the mode, header line or margin? */ | 36482 | /* Mouse is on a line or margin? */ |
| 36478 | if (part == ON_MODE_LINE || part == ON_HEADER_LINE || part == ON_TAB_LINE | 36483 | if (part == ON_MODE_LINE || part == ON_HEADER_LINE || part == ON_TAB_LINE |
| 36479 | || part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) | 36484 | || part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) |
| 36480 | { | 36485 | { |
| 36481 | note_mode_line_or_margin_highlight (window, x, y, part); | 36486 | note_line_or_margin_highlight (window, x, y, part); |
| 36482 | 36487 | ||
| 36483 | #ifdef HAVE_WINDOW_SYSTEM | 36488 | #ifdef HAVE_WINDOW_SYSTEM |
| 36484 | if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) | 36489 | if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) |