GNU bug report logs - #31975
Emacs NS port `M-x customize` Mouse Autoselect Window (point-to-focus) has no effect

Previous Next

Package: emacs;

Reported by: Van L <van <at> scratch.space>

Date: Tue, 26 Jun 2018 07:15:02 UTC

Severity: wishlist

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31975 in the body.
You can then email your comments to 31975 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Tue, 26 Jun 2018 07:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Van L <van <at> scratch.space>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 Jun 2018 07:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Van L <van <at> scratch.space>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Tue, 26 Jun 2018 17:13:40 +1000
Hello,

The customized setting for point-to-focus 
has no effect.

Maybe a tweak for Emacs is all you 
need to point-to-focus as discussed 
at stackoverflow.

#+NAME: point-to-focus
#+BEGIN_EXAMPLE
  https://stackoverflow.com/questions/98310/focus-follows-mouse-plus-auto-raise-on-mac-os-x
    defaults write com.apple.Terminal FocusFollowsMouse -bool true
#+END_EXAMPLE

#+NAME: `M-x customize` Mouse Autoselect Window
#+BEGIN_EXAMPLE
   Non-nil means autoselect window with mouse pointer. Hide
   If nil, do not autoselect windows.
   A positive number means delay autoselection by that many seconds: a
   window is autoselected only after the mouse has remained in that
   window for the duration of the delay.
   A negative number has a similar effect, but causes windows to be
   autoselected only after the mouse has stopped moving.  (Because of
   the way Emacs compares mouse events, you will occasionally wait twice
   that time before the window gets selected.)
   Any other value means to autoselect window instantaneously when the
   mouse pointer enters it.
   
   Autoselection selects the minibuffer only if it is active, and never
   unselects the minibuffer if it is active.
   
   When customizing this variable make sure that the actual value of
   ‘focus-follows-mouse’ matches the behavior of your window manager.

#+END_EXAMPLE







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Tue, 26 Jun 2018 14:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van L <van <at> scratch.space>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Tue, 26 Jun 2018 17:40:43 +0300
> From: Van L <van <at> scratch.space>
> Date: Tue, 26 Jun 2018 17:13:40 +1000
> 
> The customized setting for point-to-focus 
> has no effect.

On macOS?  Or in general?  (And why doesn't this report include all
the details collected by "M-x report-emacs-bug"?)

> Maybe a tweak for Emacs is all you 
> need to point-to-focus as discussed 
> at stackoverflow.
> 
> #+NAME: point-to-focus
> #+BEGIN_EXAMPLE
>   https://stackoverflow.com/questions/98310/focus-follows-mouse-plus-auto-raise-on-mac-os-x
>     defaults write com.apple.Terminal FocusFollowsMouse -bool true
> #+END_EXAMPLE

AFAIU, this is outside of Emacs, right?

> #+NAME: `M-x customize` Mouse Autoselect Window
> #+BEGIN_EXAMPLE
>    Non-nil means autoselect window with mouse pointer. Hide
>    If nil, do not autoselect windows.
>    A positive number means delay autoselection by that many seconds: a
>    window is autoselected only after the mouse has remained in that
>    window for the duration of the delay.
>    A negative number has a similar effect, but causes windows to be
>    autoselected only after the mouse has stopped moving.  (Because of
>    the way Emacs compares mouse events, you will occasionally wait twice
>    that time before the window gets selected.)
>    Any other value means to autoselect window instantaneously when the
>    mouse pointer enters it.
>    
>    Autoselection selects the minibuffer only if it is active, and never
>    unselects the minibuffer if it is active.
>    
>    When customizing this variable make sure that the actual value of
>    ‘focus-follows-mouse’ matches the behavior of your window manager.
> 
> #+END_EXAMPLE

And how is this part relevant?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Tue, 26 Jun 2018 15:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Van L <van <at> scratch.space>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Wed, 27 Jun 2018 01:26:45 +1000
> On macOS?

Emacs 26.1 NS port is on Apple Mac OS.

> this is outside of Emacs, right?

There is the chance of the following call to work, no?

  `defaults write org.gnu.Emacs FocusFollowsMouse -bool true`

If not, why not one day in the far off distant future.

From what I can tell "M-x report-emacs-bug” needs 
email set in Emacs and a look at Gnus involves putting 
cleartext password on a one line setting

> 
>> #+NAME: `M-x customize` Mouse Autoselect Window
>> #+BEGIN_EXAMPLE
>>   Non-nil means autoselect window with mouse pointer. Hide
>>   If nil, do not autoselect windows.
>>   A positive number means delay autoselection by that many seconds: a
>>   window is autoselected only after the mouse has remained in that
>>   window for the duration of the delay.
>>   A negative number has a similar effect, but causes windows to be
>>   autoselected only after the mouse has stopped moving.  (Because of
>>   the way Emacs compares mouse events, you will occasionally wait twice
>>   that time before the window gets selected.)
>>   Any other value means to autoselect window instantaneously when the
>>   mouse pointer enters it.
>> 
>>   Autoselection selects the minibuffer only if it is active, and never
>>   unselects the minibuffer if it is active.
>> 
>>   When customizing this variable make sure that the actual value of
>>   ‘focus-follows-mouse’ matches the behavior of your window manager.
>> 
>> #+END_EXAMPLE
> 
> And how is this part relevant?

It is the setting that takes no effect 
the perceived bug that does not work as 
expected and desired, which is the cause
for this bug#31975 report.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Tue, 26 Jun 2018 15:55:01 GMT) Full text and rfc822 format available.

Message #14 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van L <van <at> scratch.space>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Tue, 26 Jun 2018 18:54:51 +0300
> From: Van L <van <at> scratch.space>
> Date: Wed, 27 Jun 2018 01:26:45 +1000
> Cc: 31975 <at> debbugs.gnu.org
> 
> > this is outside of Emacs, right?
> 
> There is the chance of the following call to work, no?
> 
>   `defaults write org.gnu.Emacs FocusFollowsMouse -bool true`
> 
> If not, why not one day in the far off distant future.

Sorry, I cannot parse that.  Too dense today, I guess.

> From what I can tell "M-x report-emacs-bug” needs 
> email set in Emacs and a look at Gnus involves putting 
> cleartext password on a one line setting

No, it doesn't.  One of the options offered when you are about to send
is to use your system's mailclient.

> >> #+NAME: `M-x customize` Mouse Autoselect Window
> >> #+BEGIN_EXAMPLE
> >>   Non-nil means autoselect window with mouse pointer. Hide
> >>   If nil, do not autoselect windows.
> >>   A positive number means delay autoselection by that many seconds: a
> >>   window is autoselected only after the mouse has remained in that
> >>   window for the duration of the delay.
> >>   A negative number has a similar effect, but causes windows to be
> >>   autoselected only after the mouse has stopped moving.  (Because of
> >>   the way Emacs compares mouse events, you will occasionally wait twice
> >>   that time before the window gets selected.)
> >>   Any other value means to autoselect window instantaneously when the
> >>   mouse pointer enters it.
> >> 
> >>   Autoselection selects the minibuffer only if it is active, and never
> >>   unselects the minibuffer if it is active.
> >> 
> >>   When customizing this variable make sure that the actual value of
> >>   ‘focus-follows-mouse’ matches the behavior of your window manager.
> >> 
> >> #+END_EXAMPLE
> > 
> > And how is this part relevant?
> 
> It is the setting that takes no effect 
> the perceived bug that does not work as 
> expected and desired, which is the cause
> for this bug#31975 report.

But the above has no relation to focus-follows-mouse.
mouse-autoselect-window works when the Emacs frame already has focus,
and it selects one window on that frame by tracking mouse movements
above the frame.  (Yes, I know that the last sentence makes it sound
like the two features are related, but that is only true on some
systems.  E.g., here focus-follows-mouse is nil, the default, whereas
the window manager is configured to give focus to the frame where
mouse is; and yet mouse-autoselect-window does work.

So I think you should set mouse-autoselect-window to t, move the mouse
between windows, then show the output of "C-h l".  Then we might have
some hint wrt what's going on.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Wed, 27 Jun 2018 04:50:02 GMT) Full text and rfc822 format available.

Message #17 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Van L <van <at> scratch.space>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Wed, 27 Jun 2018 14:49:16 +1000
> Sorry, I cannot parse that.

In other words, to demonstrate to you, 
how the desired and expected behavior 
is configured, for example, for the
Terminal app, I found and quoted what
was needed to tell the window manager
what to do.

Also, not for use with the NS port,
but x11 to a remote GNU Linux GNU Emacs,
XQuartz’s X11 Preferences has a tick box
for `Focus Follows Mouse`.

I am asking for this behavior for the mouse
on the NS port’s outer most windowing framing
boxes with the horizontal traffic lights at
the upper most left most corner. In use, I half full screen
zoom two of those, arranged left and right, in the window manager.

The mouse focus doesn’t follow Emacs’s frame arranged left and right.
`C-x o` does not skip among Emacs’s frame.

The mouse focus does follow within the Emacs’s frame on the right, 
for example, when it is split horizontally to contain a top and bottom elements.
`C-x o` does skip among top and bottom elements.

> you should set mouse-autoselect-window to t, move the mouse
> between windows, then show the output of "C-h l”.  

`mouse-autoselect-window` is t; for the following

#+BEGIN_EXAMPLE
   [next-line]
   <down> [next-line]
   <down> [next-line]
   <next> [scroll-up-command]
   <next> [scroll-up-command]
   <prior> [scroll-down-command]
   <prior> [scroll-down-command]
   <help-echo> <select-window> [handle-select-window]
   <help-echo> <help-echo> <switch-frame> [handle-switch-frame]
   <switch-frame> [handle-switch-frame]
   C-h v [describe-variable]
   m [self-insert-command]
   o [self-insert-command]
   u [self-insert-command]
   s [self-insert-command]
   e [self-insert-command]
   <tab> [minibuffer-complete]
   a [self-insert-command]
   u [self-insert-command]
   t [self-insert-command]
   <tab> [minibuffer-complete]
   <return> [minibuffer-complete-and-exit]
   C-h l [view-lossage]
   <select-window> [handle-select-window]
   <select-window> [handle-select-window]
   <help-echo> <select-window> [handle-select-window]
   <select-window> [handle-select-window]
   <help-echo> <select-window> [handle-select-window]
   <select-window> [handle-select-window]
   <select-window> [handle-select-window]
   <select-window> [handle-select-window]
   <help-echo> <select-window> [handle-select-window]
   <select-window> [handle-select-window]
   <help-echo> <select-window> [handle-select-window]
   <select-window> [handle-select-window]
   <help-echo> <select-window> [handle-select-window]
   C-h l [view-lossage]

  [back]

#+END_EXAMPLE

Repetition of lines more than two were removed.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Wed, 27 Jun 2018 07:35:01 GMT) Full text and rfc822 format available.

Message #20 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Van L <van <at> scratch.space>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Wed, 27 Jun 2018 09:34:28 +0200
>>>>    When customizing this variable make sure that the actual value of
>>>>    ‘focus-follows-mouse’ matches the behavior of your window manager.
>>>>
>>>> #+END_EXAMPLE
>>>
>>> And how is this part relevant?
>>
>> It is the setting that takes no effect
>> the perceived bug that does not work as
>> expected and desired, which is the cause
>> for this bug#31975 report.
>
> But the above has no relation to focus-follows-mouse.
> mouse-autoselect-window works when the Emacs frame already has focus,
> and it selects one window on that frame by tracking mouse movements
> above the frame.  (Yes, I know that the last sentence makes it sound
> like the two features are related, but that is only true on some
> systems.  E.g., here focus-follows-mouse is nil, the default, whereas
> the window manager is configured to give focus to the frame where
> mouse is; and yet mouse-autoselect-window does work.

I tried to clarify the doc-string.  Please have a look.

> So I think you should set mouse-autoselect-window to t, move the mouse
> between windows, then show the output of "C-h l".  Then we might have
> some hint wrt what's going on.

If this doesn't help, the OP could try to debug mouseMoved in
nsterm.c.  It might also help to enable nstrace to find out whether
there are any mouse_autoselect_window related messages and what they
say.

martin





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Wed, 27 Jun 2018 14:51:02 GMT) Full text and rfc822 format available.

Message #23 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van L <van <at> scratch.space>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Wed, 27 Jun 2018 17:50:12 +0300
> From: Van L <van <at> scratch.space>
> Date: Wed, 27 Jun 2018 14:49:16 +1000
> Cc: 31975 <at> debbugs.gnu.org
> 
> In other words, to demonstrate to you, 
> how the desired and expected behavior 
> is configured, for example, for the
> Terminal app, I found and quoted what
> was needed to tell the window manager
> what to do.

OK, but I don't think it helps us solve this problem, except by
telling that it should be possible, at least in principle.

> Also, not for use with the NS port,
> but x11 to a remote GNU Linux GNU Emacs,
> XQuartz’s X11 Preferences has a tick box
> for `Focus Follows Mouse`.

I believe this is for the remote X, so gain not useful for the problem
you have locally.

> I am asking for this behavior for the mouse
> on the NS port’s outer most windowing framing
> boxes with the horizontal traffic lights at
> the upper most left most corner. In use, I half full screen
> zoom two of those, arranged left and right, in the window manager.

Not sure I understand: are these 2 Emacs frames, or are these something
else?

> The mouse focus doesn’t follow Emacs’s frame arranged left and right.
> `C-x o` does not skip among Emacs’s frame.

Again, I'm not following: "C-x o" is not supposed to switch between
frames, it switches between windows on the same frame (as I'm sure you
know).

> The mouse focus does follow within the Emacs’s frame on the right, 
> for example, when it is split horizontally to contain a top and bottom elements.
> `C-x o` does skip among top and bottom elements.

So mouse-autoselect-window does work between windows of the same
frame, but doesn't work when you go to a window on another frame?  If
so, this is indeed a problem to solve with your window-manager, not
with Emacs: you need to configure your window-manager so that it makes
focus follow the mouse.  Emacs cannot do that; its focus-follows-mouse
variable is the means to tell Emacs, if necessary, that you have
configured the window-manager that way, but setting that variable
cannot force the window-manager to work that way.

> `mouse-autoselect-window` is t; for the following
> 
> #+BEGIN_EXAMPLE
>    [next-line]
>    <down> [next-line]
>    <down> [next-line]
>    <next> [scroll-up-command]
>    <next> [scroll-up-command]
>    <prior> [scroll-down-command]
>    <prior> [scroll-down-command]
>    <help-echo> <select-window> [handle-select-window]
>    <help-echo> <help-echo> <switch-frame> [handle-switch-frame]
>    <switch-frame> [handle-switch-frame]
>    C-h v [describe-variable]
>    m [self-insert-command]
>    o [self-insert-command]
>    u [self-insert-command]
>    s [self-insert-command]
>    e [self-insert-command]
>    <tab> [minibuffer-complete]
>    a [self-insert-command]
>    u [self-insert-command]
>    t [self-insert-command]
>    <tab> [minibuffer-complete]
>    <return> [minibuffer-complete-and-exit]
>    C-h l [view-lossage]
>    <select-window> [handle-select-window]
>    <select-window> [handle-select-window]
>    <help-echo> <select-window> [handle-select-window]
>    <select-window> [handle-select-window]
>    <help-echo> <select-window> [handle-select-window]
>    <select-window> [handle-select-window]
>    <select-window> [handle-select-window]
>    <select-window> [handle-select-window]
>    <help-echo> <select-window> [handle-select-window]
>    <select-window> [handle-select-window]
>    <help-echo> <select-window> [handle-select-window]
>    <select-window> [handle-select-window]
>    <help-echo> <select-window> [handle-select-window]
>    C-h l [view-lossage]

I do see select-window here, so the feature is working.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Wed, 27 Jun 2018 14:57:02 GMT) Full text and rfc822 format available.

Message #26 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: van <at> scratch.space, 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Wed, 27 Jun 2018 17:56:18 +0300
> Date: Wed, 27 Jun 2018 09:34:28 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> CC: 31975 <at> debbugs.gnu.org
> 
>  > But the above has no relation to focus-follows-mouse.
>  > mouse-autoselect-window works when the Emacs frame already has focus,
>  > and it selects one window on that frame by tracking mouse movements
>  > above the frame.  (Yes, I know that the last sentence makes it sound
>  > like the two features are related, but that is only true on some
>  > systems.  E.g., here focus-follows-mouse is nil, the default, whereas
>  > the window manager is configured to give focus to the frame where
>  > mouse is; and yet mouse-autoselect-window does work.
> 
> I tried to clarify the doc-string.  Please have a look.

LGTM, thanks.

>  > So I think you should set mouse-autoselect-window to t, move the mouse
>  > between windows, then show the output of "C-h l".  Then we might have
>  > some hint wrt what's going on.
> 
> If this doesn't help, the OP could try to debug mouseMoved in
> nsterm.c.  It might also help to enable nstrace to find out whether
> there are any mouse_autoselect_window related messages and what they
> say.

It sounds like the window-manager is not configured to have focus
follow mouse.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Thu, 28 Jun 2018 06:04:02 GMT) Full text and rfc822 format available.

Message #29 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Van L <van <at> scratch.space>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Thu, 28 Jun 2018 16:03:09 +1000
>> Terminal app, I found and quoted what
>> was needed to tell the window manager
>> what to do.
> 
> I don't think it helps us solve this problem
> 
> I believe this is for the remote X

I believe the cases of Terminal app, XQuartz 
prove it is possible.

> are these 2 Emacs frames

Yes, based on the UI experience on NS port creating a `new frame`
which is selectable from the Emacs’s Icon’s context menu emanating 
from the Dock.


> I'm not following: "C-x o" is not supposed to switch between
> frames

I included that as a test case to make distinct what is the 
frame and window according to terms you use.

> So mouse-autoselect-window does work between windows of the same
> frame, but doesn't work when you go to a window on another frame?  If
> so, this is indeed a problem to solve with your window-manager, not
> with Emacs

I believe Emacs can model how it should interact with this particular
window manager based on how Terminal app, XQuartz does it right.

> I do see select-window here, so the feature is working.

The select is working between boxes (windows) within an outer most box (frame).

The ask is for the mouse focus to follow select on the outer most boxes (frames).

I haven’t built Emacs 27 on Mac OS and will see what has been suggested by 
OC’s nsterm.c’s mouseMoved.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Thu, 28 Jun 2018 10:41:01 GMT) Full text and rfc822 format available.

Message #32 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Van L <van <at> scratch.space>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: martin rudalics <rudalics <at> gmx.at>, 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Thu, 28 Jun 2018 20:40:03 +1000
> It sounds like the window-manager is not configured to have focus
> follow mouse.

I believe I was after `mouse-autoselect-frame` now 
that I know the relationship of frame to windows within it.

The window-manager’s default is for click to focus, but two apps
are known to be customizeable to `focus-follow-mouse` for frames
belonging to the app.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Thu, 28 Jun 2018 13:00:02 GMT) Full text and rfc822 format available.

Message #35 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van L <van <at> scratch.space>
Cc: rudalics <at> gmx.at, 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Thu, 28 Jun 2018 15:59:30 +0300
> From: Van L <van <at> scratch.space>
> Date: Thu, 28 Jun 2018 20:40:03 +1000
> Cc: martin rudalics <rudalics <at> gmx.at>,
>  31975 <at> debbugs.gnu.org
> 
> I believe I was after `mouse-autoselect-frame` now 
> that I know the relationship of frame to windows within it.

You mean, hypothetically?  Because I don't think such a feature exists
in Emacs as of now.

> The window-manager’s default is for click to focus, but two apps
> are known to be customizeable to `focus-follow-mouse` for frames
> belonging to the app.

Can't you change the window-manager's default?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Thu, 28 Jun 2018 13:06:01 GMT) Full text and rfc822 format available.

Message #38 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Van L <van <at> scratch.space>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Thu, 28 Jun 2018 23:05:26 +1000
> You mean, hypothetically?  

It might be trivial for the NS/Mac port developers
familiar with plumbing conventions for apps on the 
platform.

> Can't you change the window-manager's default?

The wm allows and honors apps wanting that behavior.
I guess the nsterm or macterm source files for
interacting with frames and focus need a little
kick.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Thu, 28 Jun 2018 18:26:02 GMT) Full text and rfc822 format available.

Message #41 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Van L <van <at> scratch.space>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Thu, 28 Jun 2018 19:24:57 +0100
On Thu, Jun 28, 2018 at 11:05:26PM +1000, Van L wrote:
> 
> > You mean, hypothetically?  
> 
> It might be trivial for the NS/Mac port developers
> familiar with plumbing conventions for apps on the 
> platform.
> 
> > Can't you change the window-manager's default?
> 
> The wm allows and honors apps wanting that behavior.
> I guess the nsterm or macterm source files for
> interacting with frames and focus need a little
> kick.

It shouldn’t be hard, although I’d mark this as wishlist for now as
I’m working on other things.

If someone else fancies giving it a go I think the simplest approach
is to modify [EmacsEvent mouseEntered:] to make the window key if some
variable is set.
-- 
Alan Third




Severity set to 'wishlist' from 'minor' Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Thu, 28 Jun 2018 18:26:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Wed, 20 Oct 2021 02:09:02 GMT) Full text and rfc822 format available.

Message #46 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Van L <van <at> scratch.space>
Cc: alan <at> idiocy.org, 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect
 Window (point-to-focus) has no effect
Date: Wed, 20 Oct 2021 10:08:05 +0800
Van L <van <at> scratch.space> writes:

>    Non-nil means autoselect window with mouse pointer. Hide
>    If nil, do not autoselect windows.
>    A positive number means delay autoselection by that many seconds: a
>    window is autoselected only after the mouse has remained in that
>    window for the duration of the delay.
>    A negative number has a similar effect, but causes windows to be
>    autoselected only after the mouse has stopped moving.  (Because of
>    the way Emacs compares mouse events, you will occasionally wait twice
>    that time before the window gets selected.)
>    Any other value means to autoselect window instantaneously when the
>    mouse pointer enters it.
>    
>    Autoselection selects the minibuffer only if it is active, and never
>    unselects the minibuffer if it is active.
>    
>    When customizing this variable make sure that the actual value of
>    ‘focus-follows-mouse’ matches the behavior of your window manager.

After reading through the entire thread, I still don't understand what
the problem is.  But if it's that `mouse-autoselect-window' is not
respected on the NS port, then I think this bug is now outdated, because
the code to do that is already present and works.

(On GNUstep, at least.  I don't know about macOS)

Alan, do you know anything about this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Wed, 20 Oct 2021 20:27:02 GMT) Full text and rfc822 format available.

Message #49 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Van L <van <at> scratch.space>, 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect Window
 (point-to-focus) has no effect
Date: Wed, 20 Oct 2021 21:26:49 +0100
On Wed, Oct 20, 2021 at 10:08:05AM +0800, Po Lu wrote:
> Van L <van <at> scratch.space> writes:
> 
> >    Non-nil means autoselect window with mouse pointer. Hide
> >    If nil, do not autoselect windows.
> >    A positive number means delay autoselection by that many seconds: a
> >    window is autoselected only after the mouse has remained in that
> >    window for the duration of the delay.
> >    A negative number has a similar effect, but causes windows to be
> >    autoselected only after the mouse has stopped moving.  (Because of
> >    the way Emacs compares mouse events, you will occasionally wait twice
> >    that time before the window gets selected.)
> >    Any other value means to autoselect window instantaneously when the
> >    mouse pointer enters it.
> >    
> >    Autoselection selects the minibuffer only if it is active, and never
> >    unselects the minibuffer if it is active.
> >    
> >    When customizing this variable make sure that the actual value of
> >    ‘focus-follows-mouse’ matches the behavior of your window manager.
> 
> After reading through the entire thread, I still don't understand what
> the problem is.  But if it's that `mouse-autoselect-window' is not
> respected on the NS port, then I think this bug is now outdated, because
> the code to do that is already present and works.
> 
> (On GNUstep, at least.  I don't know about macOS)
> 
> Alan, do you know anything about this?

The OP expected changing the setting in Emacs to change how the WM in
macOS works, which it doesn't. Since you can't choose another WM in
macOS and the standard one doesn't support focus-follows-mouse there's
not much to do here.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31975; Package emacs. (Thu, 21 Oct 2021 03:15:01 GMT) Full text and rfc822 format available.

Message #52 received at 31975 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: Po Lu <luangruo <at> yahoo.com>, Van L <van <at> scratch.space>,
 31975 <at> debbugs.gnu.org
Subject: Re: bug#31975: Emacs NS port `M-x customize` Mouse Autoselect
 Window (point-to-focus) has no effect
Date: Thu, 21 Oct 2021 05:13:52 +0200
Alan Third <alan <at> idiocy.org> writes:

> The OP expected changing the setting in Emacs to change how the WM in
> macOS works, which it doesn't. Since you can't choose another WM in
> macOS and the standard one doesn't support focus-follows-mouse there's
> not much to do here.

OK; I'm closing this bug report, then.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 31975 <at> debbugs.gnu.org and Van L <van <at> scratch.space> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 21 Oct 2021 03:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 18 Nov 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.