Subject: bug#65116: 29.1; query-replace-read-args fails reading second arg in detached minibuf

From: Alan Mackenzie <[email-masked]>
Date: Sat, 13 Jan 2024 17:47:09 +0000

Hello, Jim.

On Sat, Jan 13, 2024 at 11:00:50 -0600, Jim Rees wrote:
> Could it have something to do with the mouse warping? Why is the mouse
> warping at all? I would prefer it stay right where it is. I'm pretty
> sure it did at some recent time in the past, maybe emacs 26.

If so, what is causing the mouse to warp at all?  Emacs shifts the focus
from the main frame to the minibuffer frame, so presumably that causes a
mouse warp.  Or does it?

Something is remembering state.  Performing a minibuffer action sets this
state, namely to something which allows M-% to work.  Moving the mouse
out of the main frame changes this state to something where M-% no longer
works, even after moving it back into the frame.

Maybe the minibuffer action causes some variable to "remember" it's "in
the minibuffer", so it doesn't try later to shift the focus to the main
frame, whereas when the mouse has been moved out and in again, this
variable "remembers" it's "in the main frame".  Or something like that.

But the problem only occurs during the second minibuffer use in M-%, not
the first one.

Is this state store in Emacs, in twm, or in X-Windows?  I'm inclined to
suspect twm, since the bug only seems to occur with twm and one other
window manager.  But my previous paragraph implies there's some relevant
state stored in Emacs, too.

I wish I knew more about X-Windows and window managers.

-- 
Alan Mackenzie (Nuremberg, Germany).