emacs-devel
[Top][All Lists]
Advanced

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

Re: PATCH: focus follows mouse in C


From: Pavel Janík
Subject: Re: PATCH: focus follows mouse in C
Date: Thu, 07 Feb 2002 22:31:16 +0100
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i386-suse-linux-gnu)

   From: Richard Stallman <address@hidden>
   Date: Thu, 7 Feb 2002 07:56:45 -0700 (MST)

   >     +  if (x_autoselect_window_p)
   >     +    {
   >     +      int area;
   >     +      Lisp_Object window;
   >     +
   >     +      window = window_from_coordinates (frame, XINT (event->x), XINT 
(event->y), &area, 0);
   >     +
   >     +      if (WINDOW_LIVE_P (window) && !MINI_WINDOW_P (XWINDOW(window)))
   >     +      Fselect_window(window);
   >     +    }
   >     +
   > 
   > It looks like this selects the window on every motion of the mouse.
   > That may be what you don't like.  Maybe it should select the window
   > only when the mouse moves into a different window.

For the user, it has this behaviour. Yes, it is ugly to call
Fselect_window for each window and wait for it to execute

  if (EQ (window, selected_window))
    return window;

It should be directly here. Fixed.

   > Also, it seems to be completely unwilling to select a minibuffer window.
   > When the minibuffer is active, it should be selectable like any other 
window.

Nice idea, here it is:

  if (x_autoselect_window_p)
    {
      int area;
      Lisp_Object window;

      window = window_from_coordinates (frame, XINT (event->x), XINT 
(event->y), &area, 0);

      /* Window will be selected only when it is not selected now.
         Minibuffer window will be selected iff it is active.  */
      if (!EQ (window, selected_window)
          && (!MINI_WINDOW_P (XWINDOW(window))
              || (EQ (window, minibuf_window) && minibuf_level > 0)))
        Fselect_window (window);
    }

Maybe we can also use `area' here to allow user to customize this
behaviour. E.g. mouse over mode-line/fringe/scroll-bar does/doesn't select
window or something similar. Maybe a customizable list
x-autoselect-window-parts with full value '(text mode-line vertical-border
header-line left-fringe right-fringe)? If something will be missing here,
mouse over it can not select the window? Well, maybe I'm crazy, but the
implementation of this will surely wait for feedback from real users of
this feature.

What I do not like when x-autoselect-window is t, is connected with my
working habits. I think it can be *really* useful to people who use
focus-follows-mouse in their window managers and are used to that
behaviour.
-- 
Pavel Janík

Ask three people which VM is best, and you will get four answers ;)
                  -- Hubert Mantel about VM in 2.4.x



reply via email to

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