emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 5743b74d4b 1/2: Improve mouse dragging


From: Po Lu
Subject: Re: master 5743b74d4b 1/2: Improve mouse dragging
Date: Thu, 12 May 2022 21:23:19 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> "Used to use"?  And now we don't?  But your changes are in
> tooltip-show, so if we don't use it anymore, why the changes?

My changes are in `mouse-drag-and-drop-region-display-tooltip', which is
used by the `mouse-drag-and-drop-region' feature to display a tooltip
that follows the mouse.  I didn't touch `tooltip-show' at all.

> Could you possibly post a more detailed response, one which would
> explain that change starting from how this stuff behaves in Emacs 28
> and why we needed to change it in Emacs 29, without omitting any
> crucial details?

The behavior in Emacs 28 is a serious bug (and a regression from Emacs
27) caused by the code that lets Emacs 28 display variable-width fonts
in tooltips, but apparently nobody was using that particular feature
during the entire development process of Emacs 28, so it wasn't found in
time for the release.

That code would add text properties to the `text' argument to
`x-show-tip', which is bad, because `mouse-drag-and-drop-region'
reinserts the string passed as `text' into the buffer the mouse was
dropped on top of afterwards, which causes the inserted text to be
propertized with the wrong face.

I fixed that bug in `mouse-drag-and-drop-region' this March by making it
use `x-show-tip' directly instead of `tooltip-show' (it is safe because
we don't do anything `tooltip-show' would not.)  But it turns out that
`tooltip-show' does some processing on the frame parameters to make them
reflect the background and foreground colors of the tooltip face before
passing them to `x-show-tip', the absence of which caused tooltip colors
set by some themes to not take effect in tooltips shown while dragging
text, which is what this change fixes.  That was fixed by this change.

Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]