emacs-devel
[Top][All Lists]
Advanced

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

Re: master 68e293c81d: Fix reporting of imaginary key prefixes on toolki


From: Robert Pluim
Subject: Re: master 68e293c81d: Fix reporting of imaginary key prefixes on toolkit tool and menu bars
Date: Wed, 02 Mar 2022 14:35:39 +0100

>>>>> On Wed,  2 Mar 2022 06:02:33 -0500 (EST), Po Lu via Mailing list for 
>>>>> Emacs changes <emacs-diffs@gnu.org> said:

    Po>    /* Report mouse events on the tab bar and (on GUI frames) on the
    Po>       tool bar.  */
    Po> @@ -5280,6 +5282,20 @@ make_lispy_position (struct frame *f, 
Lisp_Object x, Lisp_Object y,
    Po>          coordinates.  FIXME!  */
    Po>        window_or_frame = Qnil;
    Po>      }
    Po> +
    Po> +  if (FRAME_TERMINAL (f)->toolkit_position_hook)
    Po> +    {
    Po> +      FRAME_TERMINAL (f)->toolkit_position_hook (f, mx, my, 
&menu_bar_p,
    Po> +                                                &tool_bar_p);
    Po> +
    Po> +      if (NILP (track_mouse) || EQ (track_mouse, Qt))
    Po> +       {
    Po> +         if (menu_bar_p)
    Po> +           posn = Qmenu_bar;
    Po> +         else if (tool_bar_p)
    Po> +           posn = Qtool_bar;
    Po> +       }
    Po> +    }


If the only purpose of menu_bar_p and tool_bar_p is to set an
appropriate value for posn, then would it not be simpler to have the
hook return the desired value directly? Also, Iʼd put the track_mouse
if condition as the outer test, to avoid calling the hook when its
value is not actually needed.

Robert
-- 



reply via email to

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