diff options
| author | Martin Rudalics | 2025-12-20 15:12:39 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2025-12-20 15:12:39 +0100 |
| commit | cf2e676ecab42a3f2add728eca20bb23d2a73728 (patch) | |
| tree | e394d8ea91e15453c66c7c0441b17a942386df2f | |
| parent | 69ca26996c20fb0acea98a64b9174e283d1a3375 (diff) | |
| download | emacs-cf2e676ecab42a3f2add728eca20bb23d2a73728.tar.gz emacs-cf2e676ecab42a3f2add728eca20bb23d2a73728.zip | |
Don't change visibility of tty root frames (Bug#80032)
* src/frame.c (Fmake_frame_visible, Fmake_frame_invisible):
* doc/lispref/frames.texi (Visibility of Frames): Don't change
visibility of tty root frames. (Bug#80032)
| -rw-r--r-- | doc/lispref/frames.texi | 9 | ||||
| -rw-r--r-- | src/frame.c | 30 |
2 files changed, 15 insertions, 24 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index bc7c1e4915a..77b606282da 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -3391,13 +3391,10 @@ all child frames of @var{frame} (and their descendants) invisible too | |||
| 3391 | Unless @var{force} is non-@code{nil}, this function refuses to make | 3391 | Unless @var{force} is non-@code{nil}, this function refuses to make |
| 3392 | @var{frame} invisible if all other frames are invisible. On a text | 3392 | @var{frame} invisible if all other frames are invisible. On a text |
| 3393 | terminal this will make @var{frame} invisible if and only if it is a | 3393 | terminal this will make @var{frame} invisible if and only if it is a |
| 3394 | child frame or at least one other non-child frame (@pxref{Child Frames}) | 3394 | child frame (@pxref{Child Frames}). In this case, if @var{frame} is |
| 3395 | on that terminal exists. In the former case, if @var{frame} is | ||
| 3396 | selected, it will select the first visible ancestor of @var{frame} | 3395 | selected, it will select the first visible ancestor of @var{frame} |
| 3397 | instead. In the latter case it will make another non-child frame on | 3396 | instead. In addition, it will remove all child frames with @var{frame} |
| 3398 | that terminal visible and the new top frame (@pxref{Frames}) of that | 3397 | as their ancestor from display. |
| 3399 | terminal. In either case, it will remove all child frames with | ||
| 3400 | @var{frame} as their ancestor from display. | ||
| 3401 | @end deffn | 3398 | @end deffn |
| 3402 | 3399 | ||
| 3403 | The visibility status of a frame is also available as a frame | 3400 | The visibility status of a frame is also available as a frame |
diff --git a/src/frame.c b/src/frame.c index 131f1967424..49317379354 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3366,7 +3366,7 @@ If omitted, FRAME defaults to the currently selected frame. */) | |||
| 3366 | if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook) | 3366 | if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook) |
| 3367 | FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, true); | 3367 | FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, true); |
| 3368 | 3368 | ||
| 3369 | if (is_tty_frame (f)) | 3369 | if (is_tty_child_frame (f)) |
| 3370 | { | 3370 | { |
| 3371 | SET_FRAME_VISIBLE (f, true); | 3371 | SET_FRAME_VISIBLE (f, true); |
| 3372 | tty_raise_lower_frame (f, true); | 3372 | tty_raise_lower_frame (f, true); |
| @@ -3410,11 +3410,9 @@ Normally you may not make FRAME invisible if all other frames are | |||
| 3410 | invisible, but if the second optional argument FORCE is non-nil, you may | 3410 | invisible, but if the second optional argument FORCE is non-nil, you may |
| 3411 | do so. | 3411 | do so. |
| 3412 | 3412 | ||
| 3413 | On a text terminal make FRAME invisible if and only FRAME is either a | 3413 | On a text terminal make FRAME invisible if and only if FRAME is a child |
| 3414 | child frame or another non-child frame can be found. In the former | 3414 | frame. If, in that case, FRAME is the selected frame, select the first |
| 3415 | case, if FRAME is the selected frame, select the first visible ancestor | 3415 | visible ancestor of FRAME instead. */) |
| 3416 | of FRAME instead. In the latter case, if FRAME is the top frame of its | ||
| 3417 | terminal, make another frame that terminal's top frame. */) | ||
| 3418 | (Lisp_Object frame, Lisp_Object force) | 3416 | (Lisp_Object frame, Lisp_Object force) |
| 3419 | { | 3417 | { |
| 3420 | struct frame *f = decode_live_frame (frame); | 3418 | struct frame *f = decode_live_frame (frame); |
| @@ -3427,18 +3425,14 @@ terminal, make another frame that terminal's top frame. */) | |||
| 3427 | if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook) | 3425 | if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook) |
| 3428 | FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false); | 3426 | FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false); |
| 3429 | 3427 | ||
| 3430 | SET_FRAME_VISIBLE (f, false); | 3428 | if (is_tty_child_frame (f) && EQ (frame, selected_frame)) |
| 3431 | 3429 | { | |
| 3432 | if (is_tty_frame (f) && EQ (frame, selected_frame)) | 3430 | SET_FRAME_VISIBLE (f, false); |
| 3433 | /* On a tty if FRAME is the selected frame, we have to select another | 3431 | /* If FRAME is a tty child frame and the selected frame, we have |
| 3434 | frame instead. If FRAME is a child frame, use the first visible | 3432 | to select another frame instead. Use the first visible |
| 3435 | ancestor as returned by 'mru_rooted_frame'. If FRAME is a root | 3433 | ancestor as returned by 'mru_rooted_frame'. */ |
| 3436 | frame, use the frame returned by 'next-frame' which must exist since | 3434 | Fselect_frame (mru_rooted_frame (f), Qnil); |
| 3437 | otherwise other_frames above would have lied. */ | 3435 | } |
| 3438 | Fselect_frame (FRAME_PARENT_FRAME (f) | ||
| 3439 | ? mru_rooted_frame (f) | ||
| 3440 | : next_frame (frame, make_fixnum (0)), | ||
| 3441 | Qnil); | ||
| 3442 | 3436 | ||
| 3443 | /* Make menu bar update for the Buffers and Frames menus. */ | 3437 | /* Make menu bar update for the Buffers and Frames menus. */ |
| 3444 | windows_or_buffers_changed = 16; | 3438 | windows_or_buffers_changed = 16; |