GNU bug report logs - #48229
28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Tue, 4 May 2021 15:44:02 UTC

Severity: normal

Merged with 47766

Found in version 28.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48229 in the body.
You can then email your comments to 48229 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to acm <at> muc.de, bug-gnu-emacs <at> gnu.org:
bug#48229; Package emacs. (Tue, 04 May 2021 15:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Basil L. Contovounesios" <contovob <at> tcd.ie>:
New bug report received and forwarded. Copy sent to acm <at> muc.de, bug-gnu-emacs <at> gnu.org. (Tue, 04 May 2021 15:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames
Date: Tue, 04 May 2021 16:43:17 +0100
[Message part 1 (text/plain, inline)]
With the tiling WM Xmonad (regardless of Lucid/GTK2/GTK3/PGTK toolkit),
in which new Emacs frames always receive focus by default:

0. emacs -Q
1. M-: (setq pop-up-frames 'graphic-only) RET
2. M-x TAB

This pops up and gives focus to a new frame with the *Completions*
buffer:

[2.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
Ignore the missing scrollbar; that's a separate long-standing issue ;).

3. q

As part of another long-standing issue on Xmonad (I guess because it
doesn't really do invisibility/minimisation/what-have-you), this
actually retains the *Completions* frame (which is still highlighted as
focused by the WM), but now neither frame looks "active" (all three
visible cursors are hollow):

[3.png (image/png, inline)]
[Message part 5 (text/plain, inline)]
4. Close the *Completions* frame.  In Xmonad that's Mod-Shift-c by
   default.

The minibuffer of the original frame is now selected:

[4.png (image/png, inline)]
[Message part 7 (text/plain, inline)]
5. C-g

This leaves the inactive minibuffer selected:

[5.png (image/png, inline)]
[Message part 9 (text/plain, inline)]
I think this inconsistent state might be the cause of or related to some
harder-to-reproduce "attempted to do X in sole/inactive
(mini)buffer/window" (or something like that) errors down the line with
Ivy minibuffer completion.  They happen seemingly at random when exiting
the minibuffer, perhaps multiple times an hour in a busy editing
session.  Once a frame reaches this inactive-but-selected minibuffer
state, subsequent minibuffer sessions are often problematic, so my
workaround is to simply delete that frame and hope it doesn't reoccur
for a while.  One thing that feels like it reduced the frequency of
these issues was disabling winner-mode and using {next,previous}-buffer
instead, FWIW.

This has been happening for a while now, I guess since the recent
overhaul of minibuffer behaviour (which is why I'm CCing Alan).

OTOH I can reliably reproduce the narrower issue in this report, so let
me know if you'd like me to test anything.

Thanks,

-- 
Basil

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-05-04 built on tia
Repository revision: b8f88d76ea79b12d600a090f76cea9d6ec3818f2
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux bullseye/sid

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
graphic-only
Making completion list...
Quit

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --enable-checking=structs
 --with-x-toolkit=lucid --with-file-notification=yes --with-x'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: InactiveMinibuffer

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 79371 6927)
 (symbols 48 6593 1)
 (strings 32 19873 1765)
 (string-bytes 1 631488)
 (vectors 16 12627)
 (vector-slots 8 182958 8008)
 (floats 8 31 41)
 (intervals 56 10451 4)
 (buffers 992 11))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48229; Package emacs. (Thu, 06 May 2021 07:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 48229 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>, 48229 <at> debbugs.gnu.org
Cc: Alan Mackenzie <acm <at> muc.de>
Subject: Re: bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with
 pop-up-frames
Date: Thu, 6 May 2021 09:45:38 +0200
> Ignore the missing scrollbar; that's a separate long-standing issue ;).

You mean a missing slider and a strange background?  Would it help to
put scroll bars on the right?  In either case we should investigate
this, or at least document it.

> 3. q
>
> As part of another long-standing issue on Xmonad (I guess because it
> doesn't really do invisibility/minimisation/what-have-you), this
> actually retains the *Completions* frame (which is still highlighted as
> focused by the WM), but now neither frame looks "active" (all three
> visible cursors are hollow):

Have you ever tried to customize `frame-auto-hide-function'?  If it's
really impossible to get rid of that frame, we should document it too.

> 4. Close the *Completions* frame.  In Xmonad that's Mod-Shift-c by
>     default.
>
> The minibuffer of the original frame is now selected:
>
>
>
> 5. C-g
>
> This leaves the inactive minibuffer selected:

But C-x o will select another window, right?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48229; Package emacs. (Thu, 06 May 2021 08:00:02 GMT) Full text and rfc822 format available.

Message #11 received at 48229 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 48229 <at> debbugs.gnu.org
Subject: Re: bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with
 pop-up-frames
Date: Thu, 06 May 2021 07:59:44 +0000
>
> 0. emacs -Q
> 1. M-: (setq pop-up-frames 'graphic-only) RET
> 2. M-x TAB
> 3. q
> 4. Close the *Completions* frame.  In Xmonad that's Mod-Shift-c by default.
> 5. C-g
> 
> This leaves the inactive minibuffer selected:
>

I don't use XMonad, so I can't reproduce the issue, but I'd bet this is 
related to bug#48249.  Could you try to revert 7c2ebf6e23 locally and see 
if the issue persists?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48229; Package emacs. (Thu, 06 May 2021 15:25:01 GMT) Full text and rfc822 format available.

Message #14 received at 48229 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Alan Mackenzie <acm <at> muc.de>, 48229 <at> debbugs.gnu.org
Subject: Re: bug#48229: 28.0.50; C-g leaves inactive minibuffer selected
 with pop-up-frames
Date: Thu, 06 May 2021 16:24:43 +0100
forcemerge 47766 48229
quit

martin rudalics <rudalics <at> gmx.at> writes:

>> Ignore the missing scrollbar; that's a separate long-standing issue ;).
>
> You mean a missing slider and a strange background?

Yes, although the background isn't strange: it's a small section of a
scenic wallpaper from my home country, I think you'd like it ;).

> Would it help to put scroll bars on the right?

Yes, I no longer get a missing slider after
(set-scroll-bar-mode 'right).

> In either case we should investigate this, or at least document it.

Indeed, it's on my todo to report this properly (I also get a missing
menu bar sometimes with Lucid/GTK, but I only notice it when I'm in the
middle of something else in 'emacs -Q', because in my config I have all
of these elements disabled), but I need to study for my finals first.

>> 3. q
>>
>> As part of another long-standing issue on Xmonad (I guess because it
>> doesn't really do invisibility/minimisation/what-have-you), this
>> actually retains the *Completions* frame (which is still highlighted as
>> focused by the WM), but now neither frame looks "active" (all three
>> visible cursors are hollow):
>
> Have you ever tried to customize `frame-auto-hide-function'?

Yes, in my config I have:

  (defun blc-delete-spare-frame (&optional frame force)
    "Delegate to `delete-frame' unless FRAME is alone in terminal."
    (unless (eq (next-frame) (selected-frame))
      (delete-frame frame force)))

  (setq-default frame-auto-hide-function #'blc-delete-spare-frame)

amongst various other settings and advice to elevate the citizenship
status of pop-up-frames.

> If it's really impossible to get rid of that frame, we should document
> it too.
>
>> 4. Close the *Completions* frame.  In Xmonad that's Mod-Shift-c by
>>     default.
>>
>> The minibuffer of the original frame is now selected:
>>
>> 5. C-g
>>
>> This leaves the inactive minibuffer selected:
>
> But C-x o will select another window, right?

Right, but thereafter any use of the minibuffer leaves the minibuffer
selected at the end, that is until I type C-x o again.

Anyway, I can no longer reproduce the recipe in the OP following:

Fix wrong handling of minibuffers when frames get iconified/made invisible
c873d16af6 2021-05-06 10:48:14 +0000
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=c873d16af61ae9b956c6dd6d9e50ebad2bb7666e

So I'm merging this report with bug#47766.  As Gregory points out, the
related bug#48249 remains.

Thanks,

-- 
Basil




Forcibly Merged 47766 48229. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Thu, 06 May 2021 15:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48229; Package emacs. (Thu, 06 May 2021 15:28:02 GMT) Full text and rfc822 format available.

Message #19 received at 48229 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 48229 <at> debbugs.gnu.org
Subject: Re: bug#48229: 28.0.50; C-g leaves inactive minibuffer selected
 with pop-up-frames
Date: Thu, 06 May 2021 16:27:43 +0100
Gregory Heytings <gregory <at> heytings.org> writes:

>> 0. emacs -Q
>> 1. M-: (setq pop-up-frames 'graphic-only) RET
>> 2. M-x TAB
>> 3. q
>> 4. Close the *Completions* frame.  In Xmonad that's Mod-Shift-c by default.
>> 5. C-g
>> This leaves the inactive minibuffer selected:
>
> I don't use XMonad, so I can't reproduce the issue, but I'd bet this is related
> to bug#48249.

Yes, that's a much better description of the larger issue I've been
facing.

> Could you try to revert 7c2ebf6e23 locally and see if the issue
> persists?

Replied at https://bugs.gnu.org/48249#44.

Thanks,

-- 
Basil




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 04 Jun 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.