all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#17736: 24.4.50; *-mouse-1 acts on wrong frame
@ 2014-06-08 15:05 Drew Adams
  2020-12-04 11:57 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2014-06-08 15:05 UTC (permalink / raw)
  To: 17736

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''





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-07 17:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-08 15:05 bug#17736: 24.4.50; *-mouse-1 acts on wrong frame Drew Adams
2020-12-04 11:57 ` 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

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.