emacs-devel
[Top][All Lists]
Advanced

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

Re: Mouse-hovering over 'mouse-face' overlays/regions on a TTY Emacs


From: Eli Zaretskii
Subject: Re: Mouse-hovering over 'mouse-face' overlays/regions on a TTY Emacs
Date: Sat, 05 Dec 2020 12:39:50 +0200

> Date: Wed, 02 Dec 2020 00:40:01 -0800
> From: Jared Finder <jared@finder.org>
> Cc: joaotavora@gmail.com, emacs-devel@gnu.org
> 
> * src/frame.c (Fset_mouse_position, Fset_mouse_pixel_position): Call
> Fselect_frame in all terminals, independent of defines.

Maybe I'm missing something, but I don't see how the proposed changes
cause Fselect_frame to be called fore any display type.

> diff --git a/src/frame.c b/src/frame.c
> index 17ec455d2d..4bbcb74667 100644
> --- a/src/frame.c
> +++ b/src/frame.c
> @@ -2574,22 +2574,28 @@ DEFUN ("set-mouse-position", Fset_mouse_position, 
> Sset_mouse_position, 3, 3, 0,
>    /* I think this should be done with a hook.  */
>  #ifdef HAVE_WINDOW_SYSTEM
>    if (FRAME_WINDOW_P (XFRAME (frame)))
> -    /* Warping the mouse will cause enternotify and focus events.  */
> -    frame_set_mouse_position (XFRAME (frame), xval, yval);
> -#elif defined MSDOS
> +    {
> +      /* Warping the mouse will cause enternotify and focus events.  */
> +      frame_set_mouse_position (XFRAME (frame), xval, yval);
> +      return Qnil;
> +    }
> +#endif /* HAVE_WINDOW_SYSTEM */
> +#ifdef MSDOS
>    if (FRAME_MSDOS_P (XFRAME (frame)))
>      {
>        Fselect_frame (frame, Qnil);
>        mouse_moveto (xval, yval);
> +      return Qnil;
>      }

Can we do this without introducing multiple return points?  if nothing
else, that makes it harder to assess correctness and harder to debug
the code.

> +#if defined (HAVE_GPM) && ! defined (HAVE_WINDOW_SYSTEM)
>    term_mouse_moveto (xval, yval);
>  #else

The additional HAVE_WINDOW_SYSTEM condition is because
term_mouse_moveto is conditioned the same on term.c?  If so, I think
we should remove the HAVE_WINDOW_SYSTEM part there as well: there's no
reason why a --with-x build couldn't also support GPM.

Thanks.



reply via email to

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