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: Eli Zaretskii
Subject: Re: master 5743b74d4b 1/2: Improve mouse dragging
Date: Thu, 12 May 2022 10:31:54 +0300

> branch: master
> commit 5743b74d4b2e06ace233d6b170f193a72633f218
> Author: Po Lu <luangruo@yahoo.com>
> Commit: Po Lu <luangruo@yahoo.com>
> 
>     Improve mouse dragging
>     
>     * lisp/mouse.el (mouse-drag-and-drop-region-display-tooltip):
>     Respect foreground and background parameters.
>     (mouse-drag-and-drop-region): Enable fine grained tracking.
> ---
>  lisp/mouse.el | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/lisp/mouse.el b/lisp/mouse.el
> index 0446bc6dd8..4b5f6ed223 100644
> --- a/lisp/mouse.el
> +++ b/lisp/mouse.el
> @@ -3017,7 +3017,15 @@ highlight the original region when
>    "Display TOOLTIP, a tooltip string, using `x-show-tip'.
>  Call `tooltip-show-help-non-mode' instead on non-graphical displays."
>    (if (display-graphic-p)
> -      (x-show-tip tooltip)
> +      (let ((params (copy-sequence tooltip-frame-parameters))
> +         (fg (face-attribute 'tooltip :foreground))
> +         (bg (face-attribute 'tooltip :background)))
> +     (when (stringp fg)
> +       (setf (alist-get 'foreground-color params) fg)
> +       (setf (alist-get 'border-color params) fg))
> +     (when (stringp bg)
> +       (setf (alist-get 'background-color params) bg))
> +        (x-show-tip tooltip nil params))
>      (tooltip-show-help-non-mode tooltip)))

Maybe I'm missing something here, but this seems to force the faces of
the tooltip frames to follow the attributes of faces of the frame that
is the selected frame when the tooltip is shown.  Since faces are
per-frame, why is this a good idea, and what problems does the above
change attempt to solve?  (And why do we force the border color to be
the same as the tooltip-frame's foreground color?)



reply via email to

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