GNU bug report logs -
#75931
31.0.50; mouse-face and pointer properties make pointer change back and forth
Previous Next
Reported by: Mauro Aranda <maurooaranda <at> gmail.com>
Date: Wed, 29 Jan 2025 18:23:01 UTC
Severity: normal
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75931 in the body.
You can then email your comments to 75931 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Wed, 29 Jan 2025 18:23:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Mauro Aranda <maurooaranda <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 29 Jan 2025 18:23:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
After emacs -Q, evaluate this:
(defun my-test ()
(interactive)
(switch-to-buffer "*Test*")
(kill-all-local-variables)
(make-local-variable 'widget-example-repeat)
(let ((inhibit-read-only t))
(erase-buffer))
(remove-overlays)
(insert "TEST")
(let ((ov (make-overlay (point-min) (point-max))))
(overlay-put ov 'pointer 'hand))
(let ((ov (make-overlay (point-min) (point-max))))
(overlay-put ov 'pointer 'arrow)
(overlay-put ov 'mouse-face 'shadow)
(overlay-put ov 'priority 110))
(insert "\nText without overlay"))
M-x my-test RET
Hover with the mouse the text "TEST", and move point to it (for example,
with M-<). The pointer begins to change back and forth between arrow
and hand, staying as arrow most of the time.
This seems to be toolkit-dependant, since it doesn't happen on
MS-Windows:
https://lists.gnu.org/archive/html/emacs-devel/2025-01/msg01116.html
In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2025-01-29 built on tbb-desktop
Repository revision: 142fe5ace4e5d4ed667505f73fc95757a764d530
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201001
System Description: Ubuntu 22.04.5 LTS
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
Important settings:
value of $LC_MONETARY: es_AR.UTF-8
value of $LC_NUMERIC: es_AR.UTF-8
value of $LC_TIME: es_AR.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo gtk
x-toolkit xinput2 x multi-tty move-toolbar make-network-process
tty-child-frames emacs)
Memory information:
((conses 16 38994 10422) (symbols 48 5406 0) (strings 32 12571 1813)
(string-bytes 1 303272) (vectors 16 9355)
(vector-slots 8 112629 8058) (floats 8 21 3) (intervals 56 233 0)
(buffers 992 10))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Wed, 29 Jan 2025 18:28:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 75931 <at> debbugs.gnu.org (full text, mbox):
I bisected it down to this commit:
commit 64f9fdc812bb2e1f533ae294355d33396985e469
Author: Eli Zaretskii <eliz <at> gnu.org>
Date: Thu Oct 14 11:57:07 2021 +0300
Fix display of cursor in mouse-highlighted face with ':box'
* src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
phys_cursor.x as needed if the cursor is inside mouse-highlight.
(get_cursor_offset_for_mouse_face): New function.
* src/dispnew.c (gui_update_window_end): Set
'mouse_face_overwritten_p' if the cursor is in mouse-face, to
trigger more thorough redisplay of the cursor.
(Bug#50660)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Wed, 29 Jan 2025 19:12:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 29 Jan 2025 15:27:24 -0300
> From: Mauro Aranda <maurooaranda <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>
>
> I bisected it down to this commit:
>
> commit 64f9fdc812bb2e1f533ae294355d33396985e469
> Author: Eli Zaretskii <eliz <at> gnu.org>
> Date: Thu Oct 14 11:57:07 2021 +0300
>
> Fix display of cursor in mouse-highlighted face with ':box'
>
> * src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
> phys_cursor.x as needed if the cursor is inside mouse-highlight.
> (get_cursor_offset_for_mouse_face): New function.
> * src/dispnew.c (gui_update_window_end): Set
> 'mouse_face_overwritten_p' if the cursor is in mouse-face, to
> trigger more thorough redisplay of the cursor.
> (Bug#50660)
Thanks, but it would still be good to know which code changes the
mouse pointer to hand. In the above patch, the only part that could
perhaps cause that is the first hunk, in dispnew.c, but I don't see an
immediate connection, especially since the answer is probably
somewhere in X-specific code (xterm.c etc.).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Wed, 29 Jan 2025 19:45:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Cc: 75931 <at> debbugs.gnu.org
> Date: Wed, 29 Jan 2025 21:11:05 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > * src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
> > phys_cursor.x as needed if the cursor is inside mouse-highlight.
> > (get_cursor_offset_for_mouse_face): New function.
> > * src/dispnew.c (gui_update_window_end): Set
> > 'mouse_face_overwritten_p' if the cursor is in mouse-face, to
> > trigger more thorough redisplay of the cursor.
> > (Bug#50660)
>
> Thanks, but it would still be good to know which code changes the
> mouse pointer to hand. In the above patch, the only part that could
> perhaps cause that is the first hunk, in dispnew.c, but I don't see an
> immediate connection, especially since the answer is probably
> somewhere in X-specific code (xterm.c etc.).
Does anything change if you customize void-text-area-pointer to a
value that is neither 'arrow' nor 'hand'? Do you see that 3rd shape
in the problematic scenario?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Wed, 29 Jan 2025 23:31:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 75931 <at> debbugs.gnu.org (full text, mbox):
On 29/1/25 16:11, Eli Zaretskii wrote:
>> Date: Wed, 29 Jan 2025 15:27:24 -0300
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>
>>
>> I bisected it down to this commit:
>>
>> commit 64f9fdc812bb2e1f533ae294355d33396985e469
>> Author: Eli Zaretskii <eliz <at> gnu.org>
>> Date: Thu Oct 14 11:57:07 2021 +0300
>>
>> Fix display of cursor in mouse-highlighted face with ':box'
>>
>> * src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
>> phys_cursor.x as needed if the cursor is inside mouse-highlight.
>> (get_cursor_offset_for_mouse_face): New function.
>> * src/dispnew.c (gui_update_window_end): Set
>> 'mouse_face_overwritten_p' if the cursor is in mouse-face, to
>> trigger more thorough redisplay of the cursor.
>> (Bug#50660)
>
> Thanks, but it would still be good to know which code changes the
> mouse pointer to hand. In the above patch, the only part that could
> perhaps cause that is the first hunk, in dispnew.c, but I don't see an
> immediate connection, especially since the answer is probably
> somewhere in X-specific code (xterm.c etc.).
I'll keep digging.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Wed, 29 Jan 2025 23:34:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 75931 <at> debbugs.gnu.org (full text, mbox):
On 29/1/25 16:44, Eli Zaretskii wrote:
>> Cc: 75931 <at> debbugs.gnu.org
>> Date: Wed, 29 Jan 2025 21:11:05 +0200
>> From: Eli Zaretskii <eliz <at> gnu.org>
>>
>>> * src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
>>> phys_cursor.x as needed if the cursor is inside mouse-highlight.
>>> (get_cursor_offset_for_mouse_face): New function.
>>> * src/dispnew.c (gui_update_window_end): Set
>>> 'mouse_face_overwritten_p' if the cursor is in mouse-face, to
>>> trigger more thorough redisplay of the cursor.
>>> (Bug#50660)
>>
>> Thanks, but it would still be good to know which code changes the
>> mouse pointer to hand. In the above patch, the only part that could
>> perhaps cause that is the first hunk, in dispnew.c, but I don't see an
>> immediate connection, especially since the answer is probably
>> somewhere in X-specific code (xterm.c etc.).
>
> Does anything change if you customize void-text-area-pointer to a
> value that is neither 'arrow' nor 'hand'? Do you see that 3rd shape
> in the problematic scenario?
No change.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 06:34:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 29 Jan 2025 20:30:05 -0300
> Cc: 75931 <at> debbugs.gnu.org
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> On 29/1/25 16:11, Eli Zaretskii wrote:
> >> Date: Wed, 29 Jan 2025 15:27:24 -0300
> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
> >> Cc: Eli Zaretskii <eliz <at> gnu.org>
> >>
> >> I bisected it down to this commit:
> >>
> >> commit 64f9fdc812bb2e1f533ae294355d33396985e469
> >> Author: Eli Zaretskii <eliz <at> gnu.org>
> >> Date: Thu Oct 14 11:57:07 2021 +0300
> >>
> >> Fix display of cursor in mouse-highlighted face with ':box'
> >>
> >> * src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
> >> phys_cursor.x as needed if the cursor is inside mouse-highlight.
> >> (get_cursor_offset_for_mouse_face): New function.
> >> * src/dispnew.c (gui_update_window_end): Set
> >> 'mouse_face_overwritten_p' if the cursor is in mouse-face, to
> >> trigger more thorough redisplay of the cursor.
> >> (Bug#50660)
> >
> > Thanks, but it would still be good to know which code changes the
> > mouse pointer to hand. In the above patch, the only part that could
> > perhaps cause that is the first hunk, in dispnew.c, but I don't see an
> > immediate connection, especially since the answer is probably
> > somewhere in X-specific code (xterm.c etc.).
>
> I'll keep digging.
Thanks. Can you verify that reverting the first hunk of that
changeset (2 added lines in dispnew.c:gui_update_window_end) solves
the problem? If not, then I'm afraid I'm on the wrong track and don't
understand how the rest of that changeset could cause this regression.
(I wouldn't be asking these questions if I could reproduce the problem
on my machine, but I cannot, unfortunately.)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 09:58:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 75931 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Wed, 29 Jan 2025 20:30:05 -0300
>> Cc: 75931 <at> debbugs.gnu.org
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> On 29/1/25 16:11, Eli Zaretskii wrote:
>> >> Date: Wed, 29 Jan 2025 15:27:24 -0300
>> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> >> Cc: Eli Zaretskii <eliz <at> gnu.org>
>> >>
>> >> I bisected it down to this commit:
>> >>
>> >> commit 64f9fdc812bb2e1f533ae294355d33396985e469
>> >> Author: Eli Zaretskii <eliz <at> gnu.org>
>> >> Date: Thu Oct 14 11:57:07 2021 +0300
>> >>
>> >> Fix display of cursor in mouse-highlighted face with ':box'
>> >>
>> >> * src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
>> >> phys_cursor.x as needed if the cursor is inside
mouse-highlight.
>> >> (get_cursor_offset_for_mouse_face): New function.
>> >> * src/dispnew.c (gui_update_window_end): Set
>> >> 'mouse_face_overwritten_p' if the cursor is in mouse-face, to
>> >> trigger more thorough redisplay of the cursor.
>> >> (Bug#50660)
>> >
>> > Thanks, but it would still be good to know which code changes the
>> > mouse pointer to hand. In the above patch, the only part that could
>> > perhaps cause that is the first hunk, in dispnew.c, but I don't
see an
>> > immediate connection, especially since the answer is probably
>> > somewhere in X-specific code (xterm.c etc.).
>>
>> I'll keep digging.
>
> Thanks. Can you verify that reverting the first hunk of that
> changeset (2 added lines in dispnew.c:gui_update_window_end) solves
> the problem? If not, then I'm afraid I'm on the wrong track and don't
> understand how the rest of that changeset could cause this regression.
Reverting that hunk on master doesn't solve it, but has a minor effect:
Previously, the back and forth change between hand and arrow happens
when showing the cursor and when hidding it. If I revert the hunk, it
only happens when hidding it, so it solves half the problem.
Now, if I go back to your commit, then commenting out that change in
dispnew.c does indeed solve the problem. But the next commit to xdisp.c
is this:
commit 2028df7826bb2c2909b2aaeba47282ca70c514e3
Author: Po Lu <luangruo <at> yahoo.com>
Date: Thu Oct 14 18:38:26 2021 +0800
Fix minor issues with text display when cursor is in mouse face
* src/xdisp.c (get_cursor_offset_for_mouse_face): Don't calculate
offsets for the glyph the cursor is on, and move some logic to
get_glyph_pixel_width_delta_for_mouse_face.
(fill_composite_glyph_string)
(fill_gstring_glyph_string)
(fill_glyphless_glyph_string)
(fill_glyph_string)
(fill_image_glyph_string)
(fill_xwidget_glyph_string)
(fill_stretch_glyph_string): Set s->face to mouse face whenever
appropriate.
(get_glyph_pixel_width_delta_for_mouse_face): New function.
(set_glyph_string_background_width): Update background width and
s->width to take into account differing :box properties of the mouse
face, when producing strings for the cursor.
(erase_phys_cursor): Redraw mouse face when erasing a cursor on top of
the mouse face.
* src/xterm.c (x_set_mouse_face_gc): Stop setting s->face when under
mouse face because redisplay now does that for us.
* src/w32term.c (w32_set_mouse_face_gc): Likewise.
And that commit makes the issue reappear. And as I said, now reverting
the change in dispnew.c only solves half the problem.
Perhaps it is the call to show_mouse_face that was added to
erase_phys_cursor.
> (I wouldn't be asking these questions if I could reproduce the problem
> on my machine, but I cannot, unfortunately.)
That's OK. I just hope I can help you figure it out, I doubt I could do
it on my own.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 11:38:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 30 Jan 2025 06:57:32 -0300
> Cc: 75931 <at> debbugs.gnu.org
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> Now, if I go back to your commit, then commenting out that change in
> dispnew.c does indeed solve the problem. But the next commit to xdisp.c
> is this:
> commit 2028df7826bb2c2909b2aaeba47282ca70c514e3
> Author: Po Lu <luangruo <at> yahoo.com>
> Date: Thu Oct 14 18:38:26 2021 +0800
>
> Fix minor issues with text display when cursor is in mouse face
>
> * src/xdisp.c (get_cursor_offset_for_mouse_face): Don't calculate
> offsets for the glyph the cursor is on, and move some logic to
> get_glyph_pixel_width_delta_for_mouse_face.
> (fill_composite_glyph_string)
> (fill_gstring_glyph_string)
> (fill_glyphless_glyph_string)
> (fill_glyph_string)
> (fill_image_glyph_string)
> (fill_xwidget_glyph_string)
> (fill_stretch_glyph_string): Set s->face to mouse face whenever
> appropriate.
> (get_glyph_pixel_width_delta_for_mouse_face): New function.
> (set_glyph_string_background_width): Update background width and
> s->width to take into account differing :box properties of the mouse
> face, when producing strings for the cursor.
> (erase_phys_cursor): Redraw mouse face when erasing a cursor on top of
> the mouse face.
> * src/xterm.c (x_set_mouse_face_gc): Stop setting s->face when under
> mouse face because redisplay now does that for us.
> * src/w32term.c (w32_set_mouse_face_gc): Likewise.
>
> And that commit makes the issue reappear. And as I said, now reverting
> the change in dispnew.c only solves half the problem.
>
> Perhaps it is the call to show_mouse_face that was added to
> erase_phys_cursor.
Yes, I think so. If you arrange for that call to show_mouse_face to
not redefine the mouse cursor near the end of show_mouse_face, does
the problem go away? or do you still need to revert those two lines in
dispnew.c added by my changes?
Po Lu, do you see any reason to recompute the mouse cursor in that
case?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 12:06:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 75931 <at> debbugs.gnu.org (full text, mbox):
On 30/1/25 08:36, Eli Zaretskii wrote:
>> Date: Thu, 30 Jan 2025 06:57:32 -0300
>> Cc: 75931 <at> debbugs.gnu.org
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> Now, if I go back to your commit, then commenting out that change in
>> dispnew.c does indeed solve the problem. But the next commit to xdisp.c
>> is this:
>> commit 2028df7826bb2c2909b2aaeba47282ca70c514e3
>> Author: Po Lu <luangruo <at> yahoo.com>
>> Date: Thu Oct 14 18:38:26 2021 +0800
>>
>> Fix minor issues with text display when cursor is in mouse face
>>
>> * src/xdisp.c (get_cursor_offset_for_mouse_face): Don't calculate
>> offsets for the glyph the cursor is on, and move some logic to
>> get_glyph_pixel_width_delta_for_mouse_face.
>> (fill_composite_glyph_string)
>> (fill_gstring_glyph_string)
>> (fill_glyphless_glyph_string)
>> (fill_glyph_string)
>> (fill_image_glyph_string)
>> (fill_xwidget_glyph_string)
>> (fill_stretch_glyph_string): Set s->face to mouse face whenever
>> appropriate.
>> (get_glyph_pixel_width_delta_for_mouse_face): New function.
>> (set_glyph_string_background_width): Update background width and
>> s->width to take into account differing :box properties of the
mouse
>> face, when producing strings for the cursor.
>> (erase_phys_cursor): Redraw mouse face when erasing a cursor on
top of
>> the mouse face.
>> * src/xterm.c (x_set_mouse_face_gc): Stop setting s->face when
under
>> mouse face because redisplay now does that for us.
>> * src/w32term.c (w32_set_mouse_face_gc): Likewise.
>>
>> And that commit makes the issue reappear. And as I said, now reverting
>> the change in dispnew.c only solves half the problem.
>>
>> Perhaps it is the call to show_mouse_face that was added to
>> erase_phys_cursor.
>
> Yes, I think so. If you arrange for that call to show_mouse_face to
> not redefine the mouse cursor near the end of show_mouse_face, does
> the problem go away? or do you still need to revert those two lines in
> dispnew.c added by my changes?
I've no idea how to do that. So, I did something silly:
In show_mouse_face, when draw is DRAW_MOUSE_FACE, I changed:
FRAME_OUTPUT_DATA (f)->hand_cursor
to:
FRAME_OUTPUT_DATA (f)->current_cursor
With that change, I don't need to revert the changes in dispnew.c.
But I'm way out of my league here, so I don't know if the change is
correct, most probably not. What seems correct is not specifying
hand_cursor, but rather find out which cursor do we need to draw when
redrawing it...
With the change I did, specifying pointer to hourglass (for example),
works. And not specifying it, shows the hand pointer, as it should.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 12:26:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 30 Jan 2025 09:05:23 -0300
> Cc: 75931 <at> debbugs.gnu.org, Po Lu <luangruo <at> yahoo.com>
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> On 30/1/25 08:36, Eli Zaretskii wrote:
> >> Perhaps it is the call to show_mouse_face that was added to
> >> erase_phys_cursor.
> >
> > Yes, I think so. If you arrange for that call to show_mouse_face to
> > not redefine the mouse cursor near the end of show_mouse_face, does
> > the problem go away? or do you still need to revert those two lines in
> > dispnew.c added by my changes?
>
> I've no idea how to do that. So, I did something silly:
> In show_mouse_face, when draw is DRAW_MOUSE_FACE, I changed:
> FRAME_OUTPUT_DATA (f)->hand_cursor
> to:
> FRAME_OUTPUT_DATA (f)->current_cursor
That's what I had in mind, thanks.
> With that change, I don't need to revert the changes in dispnew.c.
Good, so we now need to arrange that this particular call to
show_mouse_face doesn't touch the mouse cursor shape. Let's see what
Po Lu says about that. If he agrees that there's no need to redefine
the cursor in this particular call of show_mouse_face, the technical
solution is simple.
> But I'm way out of my league here, so I don't know if the change is
> correct, most probably not. What seems correct is not specifying
> hand_cursor, but rather find out which cursor do we need to draw when
> redrawing it...
That'd be the fallback plan, but it would require to refactor the code
in note_mouse_highlight, and in particular move the code which
determines the pointer shape into show_mouse_face (which will make it
more expensive), and also other changes, since show_mouse_face is
called from several places. Let's hope this will not be necessary.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 12:32:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 75931 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Po Lu, do you see any reason to recompute the mouse cursor in that
> case?
No, not at all.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 12:34:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 75931 <at> debbugs.gnu.org (full text, mbox):
On 30/1/25 09:25, Eli Zaretskii wrote:
>> Date: Thu, 30 Jan 2025 09:05:23 -0300
>> Cc: 75931 <at> debbugs.gnu.org, Po Lu <luangruo <at> yahoo.com>
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> On 30/1/25 08:36, Eli Zaretskii wrote:
>> >> Perhaps it is the call to show_mouse_face that was added to
>> >> erase_phys_cursor.
>> >
>> > Yes, I think so. If you arrange for that call to show_mouse_face to
>> > not redefine the mouse cursor near the end of show_mouse_face, does
>> > the problem go away? or do you still need to revert those two
lines in
>> > dispnew.c added by my changes?
>>
>> I've no idea how to do that. So, I did something silly:
>> In show_mouse_face, when draw is DRAW_MOUSE_FACE, I changed:
>> FRAME_OUTPUT_DATA (f)->hand_cursor
>> to:
>> FRAME_OUTPUT_DATA (f)->current_cursor
>
> That's what I had in mind, thanks.
Great!
>> But I'm way out of my league here, so I don't know if the change is
>> correct, most probably not. What seems correct is not specifying
>> hand_cursor, but rather find out which cursor do we need to draw when
>> redrawing it...
>
> That'd be the fallback plan, but it would require to refactor the code
> in note_mouse_highlight, and in particular move the code which
> determines the pointer shape into show_mouse_face (which will make it
> more expensive), and also other changes, since show_mouse_face is
> called from several places. Let's hope this will not be necessary.
OK. I'll keep my fingers crossed.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 19:21:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 30 Jan 2025 09:33:37 -0300
> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> On 30/1/25 09:25, Eli Zaretskii wrote:
> >>
> >> I've no idea how to do that. So, I did something silly:
> >> In show_mouse_face, when draw is DRAW_MOUSE_FACE, I changed:
> >> FRAME_OUTPUT_DATA (f)->hand_cursor
> >> to:
> >> FRAME_OUTPUT_DATA (f)->current_cursor
> >
> > That's what I had in mind, thanks.
>
> Great!
>
> >> But I'm way out of my league here, so I don't know if the change is
> >> correct, most probably not. What seems correct is not specifying
> >> hand_cursor, but rather find out which cursor do we need to draw when
> >> redrawing it...
> >
> > That'd be the fallback plan, but it would require to refactor the code
> > in note_mouse_highlight, and in particular move the code which
> > determines the pointer shape into show_mouse_face (which will make it
> > more expensive), and also other changes, since show_mouse_face is
> > called from several places. Let's hope this will not be necessary.
>
> OK. I'll keep my fingers crossed.
Please try the patch below.
diff --git a/src/xdisp.c b/src/xdisp.c
index a801caa..a047035 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1229,7 +1229,7 @@ #define face_after_it_pos(IT) face_before_or_after_it_pos (IT, false)
static void produce_special_glyphs (struct it *, enum display_element_type);
static void pad_mode_line (struct it *, bool);
-static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
+static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face, bool);
static bool coords_in_mouse_face_p (struct window *, int, int);
static void reset_box_start_end_flags (struct it *);
@@ -15052,14 +15052,14 @@ handle_tab_bar_click (struct frame *f, int x, int y, bool down_p,
{
/* Show the clicked button in pressed state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
+ show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN, true);
f->last_tab_bar_item = prop_idx; /* record the pressed tab */
}
else
{
/* Show item in released state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
+ show_mouse_face (hlinfo, DRAW_IMAGE_RAISED, true);
f->last_tab_bar_item = -1;
}
@@ -15157,7 +15157,7 @@ note_tab_bar_highlight (struct frame *f, int x, int y)
hlinfo->mouse_face_face_id = TAB_BAR_FACE_ID;
/* Display it as active. */
- show_mouse_face (hlinfo, draw);
+ show_mouse_face (hlinfo, draw, true);
}
set_help_echo:
@@ -16074,7 +16074,7 @@ handle_tool_bar_click_with_device (struct frame *f, int x, int y, bool down_p,
{
/* Show item in pressed state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
+ show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN, true);
f->last_tool_bar_item = prop_idx;
}
else
@@ -16085,7 +16085,7 @@ handle_tool_bar_click_with_device (struct frame *f, int x, int y, bool down_p,
/* Show item in released state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
+ show_mouse_face (hlinfo, DRAW_IMAGE_RAISED, true);
key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY);
@@ -16181,7 +16181,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
hlinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
/* Display it as active. */
- show_mouse_face (hlinfo, draw);
+ show_mouse_face (hlinfo, draw, true);
}
set_help_echo:
@@ -34196,12 +34196,13 @@ erase_phys_cursor (struct window *w)
/* Since erasing the phys cursor will probably lead to corruption of
the mouse face display if the glyph's pixel_width is not kept up
to date with the :box property of the mouse face, just redraw the
- mouse face. */
+ mouse face, but leave the mouse cursor as it was. */
if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p)
{
w->phys_cursor_on_p = false;
w->phys_cursor_type = NO_CURSOR;
- show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE);
+ show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE,
+ false);
return;
}
#endif
@@ -34462,7 +34463,8 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
/* Display the active region described by mouse_face_* according to DRAW. */
static void
-show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
+show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw,
+ bool define_mouse_cursor)
{
/* Don't bother doing anything if the mouse-face window is not set
up. */
@@ -34604,7 +34606,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
#ifdef HAVE_WINDOW_SYSTEM
/* Change the mouse cursor. */
- if (FRAME_WINDOW_P (f) && NILP (track_mouse))
+ if (FRAME_WINDOW_P (f) && NILP (track_mouse) && define_mouse_cursor)
{
if (draw == DRAW_NORMAL_TEXT
#ifndef HAVE_EXT_TOOL_BAR
@@ -34612,8 +34614,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
#endif
&& !EQ (hlinfo->mouse_face_window, f->tab_bar_window))
FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->text_cursor);
- else
- if (draw == DRAW_MOUSE_FACE)
+ else if (draw == DRAW_MOUSE_FACE)
FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->hand_cursor);
else
FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->nontext_cursor);
@@ -34632,7 +34633,7 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
bool cleared
= !hlinfo->mouse_face_hidden && !NILP (hlinfo->mouse_face_window);
if (cleared)
- show_mouse_face (hlinfo, DRAW_NORMAL_TEXT);
+ show_mouse_face (hlinfo, DRAW_NORMAL_TEXT, true);
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_window = Qnil;
@@ -35199,7 +35200,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
= face_at_buffer_position (w, mouse_charpos, &ignore,
mouse_charpos + 1,
!hlinfo->mouse_face_hidden, -1, 0);
- show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+ show_mouse_face (hlinfo, DRAW_MOUSE_FACE, true);
}
/* The following function is not used anymore (replaced with
@@ -35909,7 +35910,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
face_at_string_position (w, string, charpos, 0, &ignore,
glyph->face_id, true, 0);
- show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+ show_mouse_face (hlinfo, DRAW_MOUSE_FACE, true);
mouse_face_shown = true;
if (NILP (pointer))
@@ -36448,7 +36449,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
hlinfo->mouse_face_face_id
= face_at_string_position (w, object, pos, 0, &ignore,
glyph->face_id, true, 0);
- show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+ show_mouse_face (hlinfo, DRAW_MOUSE_FACE, true);
cursor = No_Cursor;
}
else
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Thu, 30 Jan 2025 20:42:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 75931 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Please try the patch below.
Thanks, but the issue remains after applying the patch.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Fri, 31 Jan 2025 07:04:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 30 Jan 2025 17:41:02 -0300
> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Please try the patch below.
>
> Thanks, but the issue remains after applying the patch.
That probably means that one or more other calls to show_mouse_face
need to be passed 'false' as the last argument. Since AFAIU only the
calls with DRAW_MOUSE_FACE can reset the mouse pointer back to the
hand shape, those are the calls that are the suspects. So please
change each such call and see which additional one needs that. I hope
there's only one such call, so please change only one call at a time,
each time returning the other calls to their current state.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Fri, 31 Jan 2025 08:53:02 GMT)
Full text and
rfc822 format available.
Message #53 received at 75931 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Thu, 30 Jan 2025 17:41:02 -0300
>> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> > Please try the patch below.
>>
>> Thanks, but the issue remains after applying the patch.
>
> That probably means that one or more other calls to show_mouse_face
> need to be passed 'false' as the last argument. Since AFAIU only the
> calls with DRAW_MOUSE_FACE can reset the mouse pointer back to the
> hand shape, those are the calls that are the suspects. So please
> change each such call and see which additional one needs that. I hope
> there's only one such call, so please change only one call at a time,
> each time returning the other calls to their current state.
It's the call at the end of mouse_face_from_buffer_pos.
But passing just false can't be right, since it would prevent drawing
the hand pointer when no pointer property is specified.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Sat, 01 Feb 2025 09:47:02 GMT)
Full text and
rfc822 format available.
Message #56 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 31 Jan 2025 05:52:07 -0300
> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> Date: Thu, 30 Jan 2025 17:41:02 -0300
> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
> >>
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >>
> >> > Please try the patch below.
> >>
> >> Thanks, but the issue remains after applying the patch.
> >
> > That probably means that one or more other calls to show_mouse_face
> > need to be passed 'false' as the last argument. Since AFAIU only the
> > calls with DRAW_MOUSE_FACE can reset the mouse pointer back to the
> > hand shape, those are the calls that are the suspects. So please
> > change each such call and see which additional one needs that. I hope
> > there's only one such call, so please change only one call at a time,
> > each time returning the other calls to their current state.
>
> It's the call at the end of mouse_face_from_buffer_pos.
I'm confused: didn't you say earlier in this discussion that removing
this call to show_mouse_face in erase_phys_cursor:
#ifdef HAVE_WINDOW_SYSTEM
/* Since erasing the phys cursor will probably lead to corruption of
the mouse face display if the glyph's pixel_width is not kept up
to date with the :box property of the mouse face, just redraw the
mouse face, but leave the mouse cursor as it was. */
if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p)
{
w->phys_cursor_on_p = false;
w->phys_cursor_type = NO_CURSOR;
show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE,
false);
return;
}
#endif
solves the problem? Is that still the case with the current code?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Sat, 01 Feb 2025 10:26:02 GMT)
Full text and
rfc822 format available.
Message #59 received at 75931 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Fri, 31 Jan 2025 05:52:07 -0300
>> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> Date: Thu, 30 Jan 2025 17:41:02 -0300
>> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> >>
>> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >>
>> >> > Please try the patch below.
>> >>
>> >> Thanks, but the issue remains after applying the patch.
>> >
>> > That probably means that one or more other calls to show_mouse_face
>> > need to be passed 'false' as the last argument. Since AFAIU only the
>> > calls with DRAW_MOUSE_FACE can reset the mouse pointer back to the
>> > hand shape, those are the calls that are the suspects. So please
>> > change each such call and see which additional one needs that. I
hope
>> > there's only one such call, so please change only one call at a time,
>> > each time returning the other calls to their current state.
>>
>> It's the call at the end of mouse_face_from_buffer_pos.
>
> I'm confused: didn't you say earlier in this discussion that removing
> this call to show_mouse_face in erase_phys_cursor:
>
> #ifdef HAVE_WINDOW_SYSTEM
> /* Since erasing the phys cursor will probably lead to corruption of
> the mouse face display if the glyph's pixel_width is not kept up
> to date with the :box property of the mouse face, just redraw the
> mouse face, but leave the mouse cursor as it was. */
> if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p)
> {
> w->phys_cursor_on_p = false;
> w->phys_cursor_type = NO_CURSOR;
> show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE,
> false);
> return;
> }
> #endif
> solves the problem?
No, I never tried removing it, I said:
"Perhaps it is the call to show_mouse_face that was added to
erase_phys_cursor."
That was because reverting the changes in dispnew.c solved the problem
after your commit, but didn't solve it anymore after the commit by Po
Lu, which added that call.
Whether passing a false argument in the call counts as "removing it",
for this matter, I don't know.
What I meant with "it's the call at the end of
mouse_face_from_buffer_pos" is that that's the other call that needed to
pass false (in addition to the one in erase_phys_cursor) for the problem
to disappear.
> Is that still the case with the current code?
Allow me to summarize:
* Does reverting the hunk from your commit in dispnew.c solves it?
- After your commit, it does.
- After the commit by Po Lu, it does not.
* Does arranging for the call to show_mouse_face to not redefine the
mouse cursor solves it?
I tried that by changing FRAME_OUTPUT_DATA (f)->hand_cursor to
FRAME_OUTPUT_DATA (f)->current_cursor
That made the problem go away, without having to revert the hunk in
dispnew.c. (From now on, everything tested is without reverting that
hunk)
Note that here I may have misunderstood
what you asked me: maybe you wanted me to do something in
erase_phys_cursor, around the call to show_mouse_face, but not inside
show_mouse_face. I didn't know what to do, but I explained that I
changed the code in show_mouse_face.
* Does the patch where the only call to show_mouse_face that passes
false as a third argument solve it?
No, it doesn't.
* Is there any other call to show_mouse_face (in addition to the one in
erase_phys_cursor that needs to pass false as a third argument for the
problem to go away? If yes, which one/s?
I found out by testing one by one that the other call it's the one in
mouse_face_from_buffer_pos.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Sat, 01 Feb 2025 12:33:02 GMT)
Full text and
rfc822 format available.
Message #62 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 1 Feb 2025 07:25:29 -0300
> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> Date: Fri, 31 Jan 2025 05:52:07 -0300
> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
> >>
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >>
> >> >> Date: Thu, 30 Jan 2025 17:41:02 -0300
> >> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> >> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
> >> >>
> >> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >> >>
> >> >> > Please try the patch below.
> >> >>
> >> >> Thanks, but the issue remains after applying the patch.
> >> >
> >> > That probably means that one or more other calls to show_mouse_face
> >> > need to be passed 'false' as the last argument. Since AFAIU only the
> >> > calls with DRAW_MOUSE_FACE can reset the mouse pointer back to the
> >> > hand shape, those are the calls that are the suspects. So please
> >> > change each such call and see which additional one needs that. I
> hope
> >> > there's only one such call, so please change only one call at a time,
> >> > each time returning the other calls to their current state.
> >>
> >> It's the call at the end of mouse_face_from_buffer_pos.
> >
> > I'm confused: didn't you say earlier in this discussion that removing
> > this call to show_mouse_face in erase_phys_cursor:
> >
> > #ifdef HAVE_WINDOW_SYSTEM
> > /* Since erasing the phys cursor will probably lead to corruption of
> > the mouse face display if the glyph's pixel_width is not kept up
> > to date with the :box property of the mouse face, just redraw the
> > mouse face, but leave the mouse cursor as it was. */
> > if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p)
> > {
> > w->phys_cursor_on_p = false;
> > w->phys_cursor_type = NO_CURSOR;
> > show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE,
> > false);
> > return;
> > }
> > #endif
> > solves the problem?
>
> No, I never tried removing it, I said:
> "Perhaps it is the call to show_mouse_face that was added to
> erase_phys_cursor."
>
> That was because reverting the changes in dispnew.c solved the problem
> after your commit, but didn't solve it anymore after the commit by Po
> Lu, which added that call.
So removing both the two lines I added in dispnew.c and the above
snippet added by Po Lu (and leaving the rest of the code intact) does
solve the problem?
I'm flying blind here, so I need all the help I can get.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Sat, 01 Feb 2025 19:16:02 GMT)
Full text and
rfc822 format available.
Message #65 received at 75931 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Sat, 1 Feb 2025 07:25:29 -0300
>> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> Date: Fri, 31 Jan 2025 05:52:07 -0300
>> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> >>
>> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >>
>> >> >> Date: Thu, 30 Jan 2025 17:41:02 -0300
>> >> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> >> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> >> >>
>> >> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >> >>
>> >> >> > Please try the patch below.
>> >> >>
>> >> >> Thanks, but the issue remains after applying the patch.
>> >> >
>> >> > That probably means that one or more other calls to
show_mouse_face
>> >> > need to be passed 'false' as the last argument. Since AFAIU
only the
>> >> > calls with DRAW_MOUSE_FACE can reset the mouse pointer back
to the
>> >> > hand shape, those are the calls that are the suspects. So please
>> >> > change each such call and see which additional one needs
that. I
>> hope
>> >> > there's only one such call, so please change only one call at
a time,
>> >> > each time returning the other calls to their current state.
>> >>
>> >> It's the call at the end of mouse_face_from_buffer_pos.
>> >
>> > I'm confused: didn't you say earlier in this discussion that removing
>> > this call to show_mouse_face in erase_phys_cursor:
>> >
>> > #ifdef HAVE_WINDOW_SYSTEM
>> > /* Since erasing the phys cursor will probably lead to
corruption of
>> > the mouse face display if the glyph's pixel_width is not
kept up
>> > to date with the :box property of the mouse face, just
redraw the
>> > mouse face, but leave the mouse cursor as it was. */
>> > if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p)
>> > {
>> > w->phys_cursor_on_p = false;
>> > w->phys_cursor_type = NO_CURSOR;
>> > show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)),
DRAW_MOUSE_FACE,
>> > false);
>> > return;
>> > }
>> > #endif
>> > solves the problem?
>>
>> No, I never tried removing it, I said:
>> "Perhaps it is the call to show_mouse_face that was added to
>> erase_phys_cursor."
>>
>> That was because reverting the changes in dispnew.c solved the problem
>> after your commit, but didn't solve it anymore after the commit by Po
>> Lu, which added that call.
>
> So removing both the two lines I added in dispnew.c and the above
> snippet added by Po Lu (and leaving the rest of the code intact) does
> solve the problem?
Yes, commenting those lines out solve it:
diff --git a/src/dispnew.c b/src/dispnew.c
index 35c8d347616..365dda47ebf 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4595,8 +4595,8 @@ gui_update_window_end (struct window *w, bool
cursor_on_p,
w->output_cursor.hpos, w->output_cursor.vpos,
w->output_cursor.x, w->output_cursor.y);
- if (cursor_in_mouse_face_p (w) && cursor_on_p)
- mouse_face_overwritten_p = 1;
+ /* if (cursor_in_mouse_face_p (w) && cursor_on_p) */
+ /* mouse_face_overwritten_p = 1; */
if (draw_window_fringes (w, true))
{
diff --git a/src/xdisp.c b/src/xdisp.c
index a801caae06f..be8385feb72 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -34199,9 +34199,9 @@ erase_phys_cursor (struct window *w)
mouse face. */
if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p)
{
- w->phys_cursor_on_p = false;
- w->phys_cursor_type = NO_CURSOR;
- show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE);
+ /* w->phys_cursor_on_p = false; */
+ /* w->phys_cursor_type = NO_CURSOR; */
+ /* show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)),
DRAW_MOUSE_FACE); */
return;
}
#endif
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Sat, 01 Feb 2025 19:56:02 GMT)
Full text and
rfc822 format available.
Message #68 received at 75931 <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 1 Feb 2025 16:15:14 -0300
> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > So removing both the two lines I added in dispnew.c and the above
> > snippet added by Po Lu (and leaving the rest of the code intact) does
> > solve the problem?
>
> Yes, commenting those lines out solve it:
Thanks. So then I expect the patch below (which _replaces_ the one I
sent before, i.e. it should be applied to the current master branch)
to also solve the problem. Does it?
diff --git a/src/dispnew.c b/src/dispnew.c
index 35c8d34..e9f3fc2 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4595,9 +4595,6 @@ gui_update_window_end (struct window *w, bool cursor_on_p,
w->output_cursor.hpos, w->output_cursor.vpos,
w->output_cursor.x, w->output_cursor.y);
- if (cursor_in_mouse_face_p (w) && cursor_on_p)
- mouse_face_overwritten_p = 1;
-
if (draw_window_fringes (w, true))
{
if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
diff --git a/src/xdisp.c b/src/xdisp.c
index 0b8dbf5..36e82f8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1229,7 +1229,7 @@ #define face_after_it_pos(IT) face_before_or_after_it_pos (IT, false)
static void produce_special_glyphs (struct it *, enum display_element_type);
static void pad_mode_line (struct it *, bool);
-static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
+static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face, bool);
static bool coords_in_mouse_face_p (struct window *, int, int);
static void reset_box_start_end_flags (struct it *);
@@ -15052,14 +15052,14 @@ handle_tab_bar_click (struct frame *f, int x, int y, bool down_p,
{
/* Show the clicked button in pressed state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
+ show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN, true);
f->last_tab_bar_item = prop_idx; /* record the pressed tab */
}
else
{
/* Show item in released state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
+ show_mouse_face (hlinfo, DRAW_IMAGE_RAISED, true);
f->last_tab_bar_item = -1;
}
@@ -15157,7 +15157,7 @@ note_tab_bar_highlight (struct frame *f, int x, int y)
hlinfo->mouse_face_face_id = TAB_BAR_FACE_ID;
/* Display it as active. */
- show_mouse_face (hlinfo, draw);
+ show_mouse_face (hlinfo, draw, true);
}
set_help_echo:
@@ -16074,7 +16074,7 @@ handle_tool_bar_click_with_device (struct frame *f, int x, int y, bool down_p,
{
/* Show item in pressed state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
+ show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN, true);
f->last_tool_bar_item = prop_idx;
}
else
@@ -16085,7 +16085,7 @@ handle_tool_bar_click_with_device (struct frame *f, int x, int y, bool down_p,
/* Show item in released state. */
if (!NILP (Vmouse_highlight))
- show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
+ show_mouse_face (hlinfo, DRAW_IMAGE_RAISED, true);
key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY);
@@ -16181,7 +16181,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
hlinfo->mouse_face_face_id = TOOL_BAR_FACE_ID;
/* Display it as active. */
- show_mouse_face (hlinfo, draw);
+ show_mouse_face (hlinfo, draw, true);
}
set_help_echo:
@@ -34196,12 +34196,13 @@ erase_phys_cursor (struct window *w)
/* Since erasing the phys cursor will probably lead to corruption of
the mouse face display if the glyph's pixel_width is not kept up
to date with the :box property of the mouse face, just redraw the
- mouse face. */
+ mouse face, but leave the mouse cursor as it was. */
if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && mouse_face_here_p)
{
w->phys_cursor_on_p = false;
w->phys_cursor_type = NO_CURSOR;
- show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE);
+ show_mouse_face (MOUSE_HL_INFO (WINDOW_XFRAME (w)), DRAW_MOUSE_FACE,
+ false);
return;
}
#endif
@@ -34462,7 +34463,8 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
/* Display the active region described by mouse_face_* according to DRAW. */
static void
-show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
+show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw,
+ bool define_mouse_cursor)
{
/* Don't bother doing anything if the mouse-face window is not set
up. */
@@ -34604,7 +34606,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
#ifdef HAVE_WINDOW_SYSTEM
/* Change the mouse cursor. */
- if (FRAME_WINDOW_P (f) && NILP (track_mouse))
+ if (FRAME_WINDOW_P (f) && NILP (track_mouse) && define_mouse_cursor)
{
if (draw == DRAW_NORMAL_TEXT
#ifndef HAVE_EXT_TOOL_BAR
@@ -34612,8 +34614,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
#endif
&& !EQ (hlinfo->mouse_face_window, f->tab_bar_window))
FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->text_cursor);
- else
- if (draw == DRAW_MOUSE_FACE)
+ else if (draw == DRAW_MOUSE_FACE)
FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->hand_cursor);
else
FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->nontext_cursor);
@@ -34632,7 +34633,7 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
bool cleared
= !hlinfo->mouse_face_hidden && !NILP (hlinfo->mouse_face_window);
if (cleared)
- show_mouse_face (hlinfo, DRAW_NORMAL_TEXT);
+ show_mouse_face (hlinfo, DRAW_NORMAL_TEXT, true);
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
hlinfo->mouse_face_window = Qnil;
@@ -35199,7 +35200,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
= face_at_buffer_position (w, mouse_charpos, &ignore,
mouse_charpos + 1,
!hlinfo->mouse_face_hidden, -1, 0);
- show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+ show_mouse_face (hlinfo, DRAW_MOUSE_FACE, true);
}
/* The following function is not used anymore (replaced with
@@ -35909,7 +35910,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
face_at_string_position (w, string, charpos, 0, &ignore,
glyph->face_id, true, 0);
- show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+ show_mouse_face (hlinfo, DRAW_MOUSE_FACE, true);
mouse_face_shown = true;
if (NILP (pointer))
@@ -36448,7 +36449,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
hlinfo->mouse_face_face_id
= face_at_string_position (w, object, pos, 0, &ignore,
glyph->face_id, true, 0);
- show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+ show_mouse_face (hlinfo, DRAW_MOUSE_FACE, true);
cursor = No_Cursor;
}
else
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Sat, 01 Feb 2025 20:29:02 GMT)
Full text and
rfc822 format available.
Message #71 received at 75931 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Sat, 1 Feb 2025 16:15:14 -0300
>> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> > So removing both the two lines I added in dispnew.c and the above
>> > snippet added by Po Lu (and leaving the rest of the code intact) does
>> > solve the problem?
>>
>> Yes, commenting those lines out solve it:
>
> Thanks. So then I expect the patch below (which _replaces_ the one I
> sent before, i.e. it should be applied to the current master branch)
> to also solve the problem. Does it?
>
Yes, it does.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sun, 02 Feb 2025 06:26:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Mauro Aranda <maurooaranda <at> gmail.com>
:
bug acknowledged by developer.
(Sun, 02 Feb 2025 06:26:02 GMT)
Full text and
rfc822 format available.
Message #76 received at 75931-done <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 1 Feb 2025 17:28:30 -0300
> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> From: Mauro Aranda <maurooaranda <at> gmail.com>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> Date: Sat, 1 Feb 2025 16:15:14 -0300
> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
> >>
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >>
> >> > So removing both the two lines I added in dispnew.c and the above
> >> > snippet added by Po Lu (and leaving the rest of the code intact) does
> >> > solve the problem?
> >>
> >> Yes, commenting those lines out solve it:
> >
> > Thanks. So then I expect the patch below (which _replaces_ the one I
> > sent before, i.e. it should be applied to the current master branch)
> > to also solve the problem. Does it?
> >
>
> Yes, it does.
Thanks, installed on master, and closing the bug.
Thanks for your help in resolving this.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#75931
; Package
emacs
.
(Sun, 02 Feb 2025 09:56:02 GMT)
Full text and
rfc822 format available.
Message #79 received at 75931 <at> debbugs.gnu.org (full text, mbox):
On 2/2/25 03:25, Eli Zaretskii wrote:
>> Date: Sat, 1 Feb 2025 17:28:30 -0300
>> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> Date: Sat, 1 Feb 2025 16:15:14 -0300
>> >> Cc: 75931 <at> debbugs.gnu.org, luangruo <at> yahoo.com
>> >> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> >>
>> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >>
>> >> > So removing both the two lines I added in dispnew.c and the above
>> >> > snippet added by Po Lu (and leaving the rest of the code
intact) does
>> >> > solve the problem?
>> >>
>> >> Yes, commenting those lines out solve it:
>> >
>> > Thanks. So then I expect the patch below (which _replaces_ the one I
>> > sent before, i.e. it should be applied to the current master branch)
>> > to also solve the problem. Does it?
>> >
>>
>> Yes, it does.
>
> Thanks, installed on master, and closing the bug.
>
> Thanks for your help in resolving this.
Thanks to you for your patience and for taking your time with this
tricky issue.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 02 Mar 2025 12:24:17 GMT)
Full text and
rfc822 format available.
This bug report was last modified 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.