all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: mouse-autoselect-window raises frames
Date: Thu, 11 Oct 2007 09:52:07 -0400	[thread overview]
Message-ID: <jwv3awhg47g.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <470DE3B2.7010109@gmx.at> (martin rudalics's message of "Thu\, 11 Oct 2007 10\:49\:54 +0200")

>>>> I started to see frames raised while I was just moving my mouse.
>>>> Placing `debug-on-entry' on `raise-frame' showed the problem to be:
>>>> 
>>>> Debugger entered--entering a function:
>>>> * raise-frame(#<frame cast.v8 0x8eba878>)
>>>> select-frame-set-input-focus(#<frame cast.v8 0x8eba878>)
>>>> handle-select-window((select-window (#<window 14 on cast.v8>)))
>>>> call-interactively(handle-select-window nil nil)
>>>> 
>>>> I think the problem is that handle-select-window shouldn't call
>>>> select-frame-set-input-focus.  It should maybe call x-focus-frame instead.
>>> Would that really be less embarassing?
>> I'm not sure I understand what you mean.

> I thought you were embarassed by seeing frames raised and wanted to know
> whether you find just focussing frames less embarassing.

The way I've usually heard "embarrassing" used, is to mean "something of
which you're ashamed".  I guess you use it here more like "annoying"?

>>> What are the values of `mouse-autoselect-window' and `focus-follows-mouse'
>>> on your system?
>> Both, but that's not relevant: handle-select-window should never call
>> "raise-frame".

> It calls `select-frame-set-input-focus' and the latter raises the frame.

Right, which is why it shouldn't call select-frame-set-input-focus.

> If you think it shouldn't, let's change `select-frame-set-input-focus'
> to do exactly what its name says and look what happens.

The docstring of select-frame-set-input-focus says pretty clearly that it
raises the frame, so it's probably better to leave it unchanged.

> (note that `x-focus-frame' is not available on Windows installs)

Are you saying that under w32, you used select-frame + raise-frame (the
only thing select-frame-set-input-focus does in this case) as a substitute
for x-focus-frame?

> I changed the behavior of mouse-autoselection because people started to
> complain about modelines getting highlighted on frames that didn't get
> the focus.  When debugging this I found out that I couldn't schedule a
> select_window event without also producing a switch_frame event.  Hence
> I had to deal somehow with selected frames that did not get the focus.

Yes, I loosely followed that thread.

> If you don't want the new behavior you currently can switch-off mouse
> autoselection or set `focus-follows-mouse' to nil.

I do want mouse autoselection.  And changing focus-follows-mouse has no
effect w.r.t this problem.  The problem is very simple: select-window events
(currently) are only generated by mouse movement and Emacs should *never*
call raise-frame in response to a mouse-movement (except when asked very
specifically, such as when the frame is marked auto-raise).

> Inherently,
> `focus-follows-mouse' should be able to distinguish window management
> policies that shift input focus to another frame when the mouse enters
> it and policies that addditionally raise the frame whenever the mouse
> enters it.  Hence, we could raise the frame in `handle-select-window'
> iff `focus-follows-mouse' eqs some value 'raise and x-focus the frame
> otherwise (I'm afraid the latter won't make any difference on Windows).
> Otherwise, we could consider a new variable `mouse-autoselect-frame' to
> customize the behavior of this.

If the window-manager wants to raise the window in order to give it focus,
that's "OK" (it would piss me off, but that's why I don't use such a window
manager).  But it's not OK for Emacs to do that.


        Stefan

  reply	other threads:[~2007-10-11 13:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-10 18:41 mouse-autoselect-window raises frames Stefan Monnier
2007-10-10 20:44 ` martin rudalics
2007-10-11  1:13   ` Stefan Monnier
2007-10-11  8:49     ` martin rudalics
2007-10-11 13:52       ` Stefan Monnier [this message]
2007-10-11 13:55         ` David Kastrup
2007-10-11 18:15         ` martin rudalics
2007-10-11 20:22           ` Stefan Monnier
2007-10-11 21:12             ` martin rudalics
2007-10-12  1:13               ` Stefan Monnier
2007-10-11 21:44             ` martin rudalics
2007-10-11 12:32     ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv3awhg47g.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.