* What are invisible frames for?
@ 2021-04-22 10:09 Alan Mackenzie
2021-04-22 12:15 ` martin rudalics
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Alan Mackenzie @ 2021-04-22 10:09 UTC (permalink / raw)
To: emacs-devel
Hello, Emacs.
In src/frame.c, the notion of an @dfn{invisible frame} is implemented.
On a GUI, when a frame is in this invisible state, it appears to be
completely inaccessible to the user - it doesn't appear anywhere on the
GUI, there appear to be no commands to access it, and so on. Only a
Lisp form can do anything with it, like making it visible again.
What is this facility used for? There're uses in dframe.el, and there's
something in cl-extra.el saying it's "support for setf". There aren't
really any uses in the C files - just one call in minibuf.c when
something else has set up an option for it.
So what is this thing for?
The reason I ask is that making frames invisible (or even iconified)
affects any minibuffers on those frames. The current handling, which is
old, moves the minibuffers onto another frame. This conflicts with the
meaning of the (newish) variable minibuffer-follows-selected-frame when
its value isn't t. In particular, when m-f-s-f is nil, minibuffers are
defined to stay on the frame they were first created on.
So, to determine how these MBs should be handled, it would be very
useful to understand what invisible frames are used for.
This has relevance for bug #47766.
Thanks in advance!
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: What are invisible frames for?
2021-04-22 10:09 What are invisible frames for? Alan Mackenzie
@ 2021-04-22 12:15 ` martin rudalics
2021-04-22 13:18 ` Stefan Monnier
2021-04-22 14:13 ` Alan Mackenzie
2021-04-22 12:31 ` Stefan Monnier
2021-04-22 14:14 ` tumashu
2 siblings, 2 replies; 11+ messages in thread
From: martin rudalics @ 2021-04-22 12:15 UTC (permalink / raw)
To: Alan Mackenzie, emacs-devel
> So, to determine how these MBs should be handled, it would be very
> useful to understand what invisible frames are used for.
I'm using a minibuffer child frame which is invisible most of the time.
It becomes visible and reparented to the selected frame whenever I want
to talk to it. Also, I have `tooltip-reuse-hidden-frame' non-nil which
means that my tooltip frame is invisible whenever it's not used.
In general, creating a new frame is expensive when you have many faces
defined (it takes up to two GC cycles here) so temporarily hiding and
reusing an existing frame is very useful for people on slower systems
like mine.
Finally note that during frame creation a frame is invisible until most
of its parameters have been processed to avoid that users have to watch
the various resizing steps and other visible changes participating in
that process.
martin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: What are invisible frames for?
2021-04-22 12:15 ` martin rudalics
@ 2021-04-22 13:18 ` Stefan Monnier
2021-04-22 21:23 ` Clément Pit-Claudel
2021-04-22 14:13 ` Alan Mackenzie
1 sibling, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2021-04-22 13:18 UTC (permalink / raw)
To: martin rudalics; +Cc: Alan Mackenzie, emacs-devel
> In general, creating a new frame is expensive when you have many faces
> defined (it takes up to two GC cycles here) so temporarily hiding and
BTW, I wish we could fix this performance bug.
Stefan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: What are invisible frames for?
2021-04-22 12:15 ` martin rudalics
2021-04-22 13:18 ` Stefan Monnier
@ 2021-04-22 14:13 ` Alan Mackenzie
2021-04-22 16:09 ` [External] : " Drew Adams
1 sibling, 1 reply; 11+ messages in thread
From: Alan Mackenzie @ 2021-04-22 14:13 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-devel
Hello, Martin.
On Thu, Apr 22, 2021 at 14:15:03 +0200, martin rudalics wrote:
> > So, to determine how these MBs should be handled, it would be very
> > useful to understand what invisible frames are used for.
> I'm using a minibuffer child frame which is invisible most of the time.
> It becomes visible and reparented to the selected frame whenever I want
> to talk to it. Also, I have `tooltip-reuse-hidden-frame' non-nil which
> means that my tooltip frame is invisible whenever it's not used.
OK. Presumably you set this up by setting the 'visibility frame
parameter. I don't think setting that frame parameter causes
Fmake_frame_invisible to get called. At least, I can't find the call
anywhere.
I don't think I was clear enough in my OP, but it's calls to
Fmake_frame_invisible which are bothering me. That function moves any
minibuffer on the frame to some other frame. I don't think it should.
That's what I'm trying to sort out.
[ .... ]
> martin
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [External] : Re: What are invisible frames for?
2021-04-22 14:13 ` Alan Mackenzie
@ 2021-04-22 16:09 ` Drew Adams
0 siblings, 0 replies; 11+ messages in thread
From: Drew Adams @ 2021-04-22 16:09 UTC (permalink / raw)
To: Alan Mackenzie, martin rudalics; +Cc: emacs-devel@gnu.org
> OK. Presumably you set this up by setting the 'visibility frame
> parameter. I don't think setting that frame parameter causes
> Fmake_frame_invisible to get called. At least, I can't find the call
> anywhere.
>
> I don't think I was clear enough in my OP, but it's calls to
> Fmake_frame_invisible which are bothering me. That function moves any
> minibuffer on the frame to some other frame. I don't think it should.
> That's what I'm trying to sort out.
I use the Lisp function `make-frame-invisible'. For example:
(defun hide-frame (frame &optional prefix)
"Make FRAME invisible. Like `make-frame-invisible', but reads frame name.
Non-nil PREFIX makes it invisible even if all other frames are invisible."
(interactive (list (read-frame "Frame to make invisible: ")))
(make-frame-invisible (get-a-frame frame) prefix))
(defun show-frame (frame)
"Make FRAME visible and raise it, without selecting it.
FRAME may be a frame or its name."
(interactive (list (read-frame "Frame to make visible: ")))
(setq frame (get-a-frame frame))
(make-frame-visible frame)
(raise-frame frame))
(defun hide-everything ()
"Hide all frames of session at once.
Iconify minibuffer frame; make all others invisible.
Remembers frame configuration in register `C-l' (Control-L).
To restore this frame configuration, use `\\[jump-to-register] C-l'."
(interactive)
(frame-configuration-to-register frame-config-register)
(let ((minibuf-frame-name
(and (boundp '1on1-minibuffer-frame)
(cdr (assq 'name (frame-parameters
1on1-minibuffer-frame)))))
(thumfr-thumbify-dont-iconify-flag nil)) ; In `thumb-frm.el'.
(dolist (frame (frame-list))
(if (eq minibuf-frame-name
(cdr (assq 'name (frame-parameters frame))))
(iconify-frame frame) ; minibuffer frame
(make-frame-invisible frame t))))) ; other frames
(defun show-hide ()
"1 frame visible: `show-hide-show-function'; else: `hide-everything'.
This acts as a toggle between showing all frames and showing only an
iconified minibuffer frame."
(interactive)
(if (< (length (visible-frame-list)) 2)
(funcall show-hide-show-function)
(hide-everything)))
https://www.emacswiki.org/emacs/download/frame-cmds.el
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: What are invisible frames for?
2021-04-22 10:09 What are invisible frames for? Alan Mackenzie
2021-04-22 12:15 ` martin rudalics
@ 2021-04-22 12:31 ` Stefan Monnier
2021-04-22 13:54 ` Michael Welsh Duggan
2021-04-22 14:14 ` tumashu
2 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2021-04-22 12:31 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: emacs-devel
> In src/frame.c, the notion of an @dfn{invisible frame} is implemented.
> On a GUI, when a frame is in this invisible state, it appears to be
> completely inaccessible to the user - it doesn't appear anywhere on the
> GUI, there appear to be no commands to access it, and so on. Only a
> Lisp form can do anything with it, like making it visible again.
>
> What is this facility used for?
I don't know what was it's original intention, but I know it's used in
`server-select-display` (via the frame property `visibility`) to create
a dummy frame that lets us "select a display" without having to select
any of its "real" frames (because it doesn't have any yet).
I have the impression that I've used it elsewhere in a similar "hackish"
way but can neither remember where nor why. And maybe I'm just misremembering.
Stefan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: What are invisible frames for?
2021-04-22 12:31 ` Stefan Monnier
@ 2021-04-22 13:54 ` Michael Welsh Duggan
2021-04-22 14:08 ` Stefan Monnier
2021-04-22 14:13 ` Eli Zaretskii
0 siblings, 2 replies; 11+ messages in thread
From: Michael Welsh Duggan @ 2021-04-22 13:54 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Alan Mackenzie, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> In src/frame.c, the notion of an @dfn{invisible frame} is implemented.
>> On a GUI, when a frame is in this invisible state, it appears to be
>> completely inaccessible to the user - it doesn't appear anywhere on the
>> GUI, there appear to be no commands to access it, and so on. Only a
>> Lisp form can do anything with it, like making it visible again.
>>
>> What is this facility used for?
>
> I don't know what was it's original intention, but I know it's used in
> `server-select-display` (via the frame property `visibility`) to create
> a dummy frame that lets us "select a display" without having to select
> any of its "real" frames (because it doesn't have any yet).
>
> I have the impression that I've used it elsewhere in a similar
> "hackish" way but can neither remember where nor why. And maybe I'm
> just misremembering.
I know that "emacs --daemon" creates a frame that isn't displayed. I
don't know if that frame is an "invisible frame" by this definition, but
I thought I'd mention it, just in case.
--
Michael Welsh Duggan
(md5i@md5i.com)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: What are invisible frames for?
2021-04-22 13:54 ` Michael Welsh Duggan
@ 2021-04-22 14:08 ` Stefan Monnier
2021-04-22 14:13 ` Eli Zaretskii
1 sibling, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2021-04-22 14:08 UTC (permalink / raw)
To: Michael Welsh Duggan; +Cc: Alan Mackenzie, emacs-devel
> I know that "emacs --daemon" creates a frame that isn't displayed. I
> don't know if that frame is an "invisible frame" by this definition, but
> I thought I'd mention it, just in case.
No, that frame is yet different: it's "visible" but it's in a "dummy
terminal" not connected to any GUI and not even a tty (it's initially
connected to the stdin/stdout, tho, so `message` gets output to stdout,
for example. It's the same dummy terminal that's used when Emacs runs
in batch mode).
BTW there are yet more forms of "invisible" frames: those frames that
are displayed on terminals that the user cannot currently see
(e.g. connected to a $DISPLAY that's in a different physical location).
This is relevant in the sense that when a minibuffer is on a frame
that's connected to display to which the user doesn't currently have
access, it can make Emacs unusable. For this reason, `server.el` calls
`top-level` sometimes.
Stefan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: What are invisible frames for?
2021-04-22 13:54 ` Michael Welsh Duggan
2021-04-22 14:08 ` Stefan Monnier
@ 2021-04-22 14:13 ` Eli Zaretskii
1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2021-04-22 14:13 UTC (permalink / raw)
To: Michael Welsh Duggan; +Cc: acm, monnier, emacs-devel
> From: Michael Welsh Duggan <mwd@md5i.com>
> Date: Thu, 22 Apr 2021 09:54:11 -0400
> Cc: Alan Mackenzie <acm@muc.de>, emacs-devel@gnu.org
>
> I know that "emacs --daemon" creates a frame that isn't displayed.
No, that's the frame created by temacs during the build. The daemon
simply doesn't delete it, unlike any other Emacs session.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re:What are invisible frames for?
2021-04-22 10:09 What are invisible frames for? Alan Mackenzie
2021-04-22 12:15 ` martin rudalics
2021-04-22 12:31 ` Stefan Monnier
@ 2021-04-22 14:14 ` tumashu
2 siblings, 0 replies; 11+ messages in thread
From: tumashu @ 2021-04-22 14:14 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1614 bytes --]
posframe use this feature, for recreate a new frame is very very slowly, while hide and show very fast :-)
--
发自我的网易邮箱手机智能版
<br/><br/><br/>
----- Original Message -----
From: "Alan Mackenzie" <acm@muc.de>
To: emacs-devel@gnu.org
Sent: Thu, 22 Apr 2021 10:09:10 +0000
Subject: What are invisible frames for?
Hello, Emacs.
In src/frame.c, the notion of an @dfn{invisible frame} is implemented.
On a GUI, when a frame is in this invisible state, it appears to be
completely inaccessible to the user - it doesn't appear anywhere on the
GUI, there appear to be no commands to access it, and so on. Only a
Lisp form can do anything with it, like making it visible again.
What is this facility used for? There're uses in dframe.el, and there's
something in cl-extra.el saying it's "support for setf". There aren't
really any uses in the C files - just one call in minibuf.c when
something else has set up an option for it.
So what is this thing for?
The reason I ask is that making frames invisible (or even iconified)
affects any minibuffers on those frames. The current handling, which is
old, moves the minibuffers onto another frame. This conflicts with the
meaning of the (newish) variable minibuffer-follows-selected-frame when
its value isn't t. In particular, when m-f-s-f is nil, minibuffers are
defined to stay on the frame they were first created on.
So, to determine how these MBs should be handled, it would be very
useful to understand what invisible frames are used for.
This has relevance for bug #47766.
Thanks in advance!
--
Alan Mackenzie (Nuremberg, Germany).
[-- Attachment #2: Type: text/html, Size: 2975 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-04-22 21:23 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-22 10:09 What are invisible frames for? Alan Mackenzie
2021-04-22 12:15 ` martin rudalics
2021-04-22 13:18 ` Stefan Monnier
2021-04-22 21:23 ` Clément Pit-Claudel
2021-04-22 14:13 ` Alan Mackenzie
2021-04-22 16:09 ` [External] : " Drew Adams
2021-04-22 12:31 ` Stefan Monnier
2021-04-22 13:54 ` Michael Welsh Duggan
2021-04-22 14:08 ` Stefan Monnier
2021-04-22 14:13 ` Eli Zaretskii
2021-04-22 14:14 ` tumashu
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).