unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: emacs-devel@gnu.org
Subject: prevent raising a frame from also input-focusing it
Date: Sun, 30 Nov 2014 10:59:26 -0800 (PST)	[thread overview]
Message-ID: <ebc54436-5414-4890-a8d9-f0b41e91e496@default> (raw)

I normally use Emacs on MS Windows.  I sometimes use Emacs
on GNU/Linux, but the available version there is Emacs 21 (!).

I don't have any problem in either of those contexts,
preventing Emacs from coupling frame raising with
input-focusing the raised frame.  At least I haven't
noticed a problem.  (I cannot connect now to the GNU/Linux
machine, to check, but I think I would have noticed such a
glaring problem.)

On Windows I just set option `w32-grab-focus-on-raise' to nil.

On GNU/Linux (Emacs 21) I don't do anything special to prevent
automatic focusing of a raised frame, AFAIK.  Why I haven't
noticed a problem with GNU/Linux, Emacs 21, I don't know.

I received a report from a user of oneonone.el, a library
that (by default) creates a standalone minibuffer frame.
It reports that the behavior on GNU/Emacs is always like
that in Windows with non-nil `w32-grab-focus-on-raise':
*raising a frame always focuses it.*

Can users change this, please?  (Is this possible already?)

Here's a simple recipe, to show why this is unusable with
a standalone minibuffer frame:

emacs -Q -l "test.el" -f "test"

Where test.el has this:
(defun test ()
  ""
  (interactive)
  (setq default-frame-alist (list (cons 'minibuffer nil)))
  (setq pop-up-frames  t)
  (setq minibuffer-frame-alist
        (list (cons 'height 2) (cons 'minibuffer 'only)))
  (make-frame minibuffer-frame-alist)
  (setq minibuffer-auto-raise t))

In *scratch*, do `C-SPC'.  You see message `Mark activated'
in the echo area.  But the input focus is switched to the
minibuffer frame, away from the *scratch* frame!

(That is what I see on MS Windows, with nil
`w32-grab-focus-on-raise', and IIUC it is the reported
behavior for GNU/Linux.)

To print a message in *output* area (echo area), Emacs has
also switched the *input* focus to that frame.  This design
makes no sense to me.  It certainly makes trying to use a
standalone minibuffer frame problematic.

Please let me know how users can prevent this input focus
switch on non-Windows platforms.  Thx.

Why should raising a frame be coupled with input-focusing
it?  Why shouldn't users be able to control this?
(And why should such coupling be the default behavior?)



             reply	other threads:[~2014-11-30 18:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30 18:59 Drew Adams [this message]
2014-11-30 23:48 ` prevent raising a frame from also input-focusing it chad
2014-12-01  0:14   ` Drew Adams
2014-12-01 19:26   ` Alan Schmitt
2014-12-01 19:59     ` chad
2014-12-01 21:31       ` Alan Schmitt

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=ebc54436-5414-4890-a8d9-f0b41e91e496@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).