unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames
@ 2021-05-04 15:43 Basil L. Contovounesios
  2021-05-06  7:45 ` martin rudalics
  2021-05-06  7:59 ` Gregory Heytings
  0 siblings, 2 replies; 5+ messages in thread
From: Basil L. Contovounesios @ 2021-05-04 15:43 UTC (permalink / raw)
  To: 48229; +Cc: Alan Mackenzie

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

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:


[-- Attachment #2: 2.png --]
[-- Type: image/png, Size: 74858 bytes --]

[-- Attachment #3: Type: text/plain, Size: 384 bytes --]


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):


[-- Attachment #4: 3.png --]
[-- Type: image/png, Size: 75061 bytes --]

[-- Attachment #5: Type: text/plain, Size: 136 bytes --]


4. Close the *Completions* frame.  In Xmonad that's Mod-Shift-c by
   default.

The minibuffer of the original frame is now selected:


[-- Attachment #6: 4.png --]
[-- Type: image/png, Size: 28750 bytes --]

[-- Attachment #7: Type: text/plain, Size: 56 bytes --]


5. C-g

This leaves the inactive minibuffer selected:


[-- Attachment #8: 5.png --]
[-- Type: image/png, Size: 27223 bytes --]

[-- Attachment #9: Type: text/plain, Size: 4194 bytes --]


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

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

* bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames
  2021-05-04 15:43 bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames Basil L. Contovounesios
@ 2021-05-06  7:45 ` martin rudalics
  2021-05-06 15:24   ` Basil L. Contovounesios
  2021-05-06  7:59 ` Gregory Heytings
  1 sibling, 1 reply; 5+ messages in thread
From: martin rudalics @ 2021-05-06  7:45 UTC (permalink / raw)
  To: Basil L. Contovounesios, 48229; +Cc: Alan Mackenzie

 > 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





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

* bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames
  2021-05-04 15:43 bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames Basil L. Contovounesios
  2021-05-06  7:45 ` martin rudalics
@ 2021-05-06  7:59 ` Gregory Heytings
  2021-05-06 15:27   ` Basil L. Contovounesios
  1 sibling, 1 reply; 5+ messages in thread
From: Gregory Heytings @ 2021-05-06  7:59 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 48229


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





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

* bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames
  2021-05-06  7:45 ` martin rudalics
@ 2021-05-06 15:24   ` Basil L. Contovounesios
  0 siblings, 0 replies; 5+ messages in thread
From: Basil L. Contovounesios @ 2021-05-06 15:24 UTC (permalink / raw)
  To: martin rudalics; +Cc: Alan Mackenzie, 48229

forcemerge 47766 48229
quit

martin rudalics <rudalics@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





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

* bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames
  2021-05-06  7:59 ` Gregory Heytings
@ 2021-05-06 15:27   ` Basil L. Contovounesios
  0 siblings, 0 replies; 5+ messages in thread
From: Basil L. Contovounesios @ 2021-05-06 15:27 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 48229

Gregory Heytings <gregory@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





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

end of thread, other threads:[~2021-05-06 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 15:43 bug#48229: 28.0.50; C-g leaves inactive minibuffer selected with pop-up-frames Basil L. Contovounesios
2021-05-06  7:45 ` martin rudalics
2021-05-06 15:24   ` Basil L. Contovounesios
2021-05-06  7:59 ` Gregory Heytings
2021-05-06 15:27   ` Basil L. Contovounesios

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git