unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 17736@debbugs.gnu.org
Subject: bug#17736: 24.4.50; *-mouse-1 acts on wrong frame
Date: Sun, 8 Jun 2014 08:05:58 -0700 (PDT)	[thread overview]
Message-ID: <7d37f10e-380f-41dd-884b-8f41003436d0@default> (raw)

Put this code in a file:

-------------------------
(defun 1on1-emacs () ""
  (interactive)
  (setq default-frame-alist (list (cons 'minibuffer nil)))
  (setq pop-up-frames  t)
  (setq minibuffer-frame-alist 1on1-minibuffer-frame-alist)
  (make-frame 1on1-minibuffer-frame-alist)
  (setq minibuffer-auto-raise t)
  (setq w32-grab-focus-on-raise nil))

(global-set-key [C-S-mouse-1]
		(lambda () (interactive)
                   (message "FR: %S" (selected-frame))))
-------------------------

runemacs.exe -Q --debug-init  -l "onetest.el" -f "1on1-emacs"

C-x b *Messages*
C-x 5 2
C-x b *scratch*

You now have a frame showing *Messages*, a frame showing *scratch*, and
a standalone minibuffer frame.  Make the first two frames small enough
that you can see both of them and the minibuffer frame.

1. Click `mouse-1' in the *scratch* frame, or otherwise select it and
   give it focus.

2. Click `C-S-mouse-1' in the *scratch* frame.  You see the message
   indicating that this is the selected frame.  Click `C-S-mouse-1' in
   the *Messages* frame.  Again, the message indicates that the clicked
   frame is the (newly) selected frame.

3. Repeat #1, to select frame *scratch*.  `M-x', then click
   `C-S-mouse-1' in the *Messages* frame (*not* the selected frame
   before you clicked).  You again see a message indicating that the
   clicked frame (*Messages*) is the (newly) selected frame.

4. With *scratch* still the selected frame, `M-x', then click in frame
   *scratch* (the selected frame before you clicked).  The message says
   that the standalone minibuffer frame is the selected frame.

1-3 are normal.  #4 is the bug.  A command bound to `C-S-mouse-1' does
not act on the frame that you click.  The same behavior occurs if you
use `S-mouse-1', `C-mouse-1', or even `mouse-1' instead of
`C-S-mouse-1' in the recipe (but you may also need to set
`*-down-mouse-1' to nil).

In sum, a mouse click while the minibuffer is active does this:

* Acts on the clicked frame, if it was not the frame selected before
  activating the minibuffer (or if is is the minibuffer frame).  This
  is what I would expect.

* Acts on the minibuffer frame, if the clicked frame was selected before
  activating the minibuffer.  This is not what I would expect (unless
  the frame clicked is the minibuffer frame).

I would expect that the frame clicked always becomes the selected frame.
Is this expectation wrong?

I ask the question about whether the behavior should be exceptional this
way, because it is not new behavior: it is at least as old as Emacs 20.
It's not clear to me why Emacs behaves this way.


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-06-01 on ODIEONE
Bzr revision: 117212 michael.albinus@gmx.de-20140601104945-g88x0mwrxorz302h
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''





             reply	other threads:[~2014-06-08 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-08 15:05 Drew Adams [this message]
2020-12-04 11:57 ` bug#17736: 24.4.50; *-mouse-1 acts on wrong frame Lars Ingebrigtsen
2020-12-04 17:43   ` Drew Adams
2020-12-04 20:46     ` Eli Zaretskii
2020-12-06 13:02     ` Lars Ingebrigtsen
2020-12-06 17:20       ` Drew Adams
2020-12-07 13:45         ` Lars Ingebrigtsen
2020-12-07 16:27           ` Drew Adams
2020-12-07 17:04             ` Eli Zaretskii

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=7d37f10e-380f-41dd-884b-8f41003436d0@default \
    --to=drew.adams@oracle.com \
    --cc=17736@debbugs.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).